def reallocatingPut()

in bijection-core/src/main/scala/com/twitter/bijection/Bufferable.scala [121:128]


  def reallocatingPut(bb: ByteBuffer)(putfn: (ByteBuffer) => ByteBuffer): ByteBuffer = {
    val init = bb.duplicate
    try {
      putfn(init)
    } catch {
      case _: BufferOverflowException => reallocatingPut(reallocate(bb))(putfn)
    }
  }