@Test public void testCopyWithPrefix() { ByteBuffer buf = ByteBuffer.allocate(4); buf.putInt(0, 55); byte prefix = 109; ByteBuffer copied = ByteBuffers.copyWithPrefix(prefix, buf); assertEquals(prefix, copied.get()); assertEquals(55, copied.getInt()); }
public static ByteBuffer copyWithPrefix(byte prefix, ByteBuffer src) { ByteBuffer buf = ByteBuffer.allocate(src.remaining() + 1); buf.put(prefix); copyTo(src, buf); buf.position(0); return buf; }
ByteBuffers { public static ByteBuffer copyWithPrefix(byte prefix, ByteBuffer src) { ByteBuffer buf = ByteBuffer.allocate(src.remaining() + 1); buf.put(prefix); copyTo(src, buf); buf.position(0); return buf; } }
ByteBuffers { public static ByteBuffer copyWithPrefix(byte prefix, ByteBuffer src) { ByteBuffer buf = ByteBuffer.allocate(src.remaining() + 1); buf.put(prefix); copyTo(src, buf); buf.position(0); return buf; }  }
ByteBuffers { public static ByteBuffer copyWithPrefix(byte prefix, ByteBuffer src) { ByteBuffer buf = ByteBuffer.allocate(src.remaining() + 1); buf.put(prefix); copyTo(src, buf); buf.position(0); return buf; }  static void copyTo(ByteBuffer src, ByteBuffer dest); static ByteBuffer copyWithPrefix(byte prefix, ByteBuffer src); static ByteBuffer copyRemaining(ByteBuffer src); static byte[] copyRemainingBytes(ByteBuffer src); static String getString(ByteBuffer buf); }
ByteBuffers { public static ByteBuffer copyWithPrefix(byte prefix, ByteBuffer src) { ByteBuffer buf = ByteBuffer.allocate(src.remaining() + 1); buf.put(prefix); copyTo(src, buf); buf.position(0); return buf; }  static void copyTo(ByteBuffer src, ByteBuffer dest); static ByteBuffer copyWithPrefix(byte prefix, ByteBuffer src); static ByteBuffer copyRemaining(ByteBuffer src); static byte[] copyRemainingBytes(ByteBuffer src); static String getString(ByteBuffer buf); static final Comparator<ByteBuffer> LEXICOGRAPHIC_COMPARATOR; }