@Override
  public SingleByteBuff put(int offset, ByteBuff src, int srcOffset, int length) {
    checkRefCount();
    if (src instanceof SingleByteBuff) {
      ByteBufferUtils.copyFromBufferToBuffer(((SingleByteBuff) src).buf, this.buf, srcOffset,
        offset, length);
    } else {
      // TODO we can do some optimization here? Call to asSubByteBuffer might
      // create a copy.
      ObjectIntPair<ByteBuffer> pair = new ObjectIntPair<>();
      src.asSubByteBuffer(srcOffset, length, pair);
      if (pair.getFirst() != null) {
        ByteBufferUtils.copyFromBufferToBuffer(pair.getFirst(), this.buf, pair.getSecond(), offset,
          length);
      }
    }
    return this;
  }
An implementation of ByteBuff where a single BB backs the BBI. This just acts as a wrapper over a
normal BB - offheap or onheap
hbase-common/src/main/java/org/apache/hadoop/hbase/nio/SingleByteBuff.java