@Override public BuffersBuffer get(final byte[] dst) { return get(dst, 0, dst.length); }
@Override public BuffersBuffer get(final ByteBuffer dst) { get(dst, dst.position(), dst.remaining()); dst.position(dst.limit()); return this; }
@Override public BuffersBuffer get(final ByteBuffer dst) { get(dst, dst.position(), dst.remaining()); dst.position(dst.limit()); return this; }
@Override public BuffersBuffer get(final ByteBuffer dst) { get(dst, dst.position(), dst.remaining()); dst.position(dst.limit()); return this; }
@Override public BuffersBuffer get(final ByteBuffer dst) { get(dst, dst.position(), dst.remaining()); dst.position(dst.limit()); return this; }
@Override public BuffersBuffer get(final ByteBuffer dst) { get(dst, dst.position(), dst.remaining()); dst.position(dst.limit()); return this; }
@Override public BuffersBuffer get(final ByteBuffer dst) { get(dst, dst.position(), dst.remaining()); dst.position(dst.limit()); return this; }
@Override public BuffersBuffer get(final ByteBuffer dst) { get(dst, dst.position(), dst.remaining()); dst.position(dst.limit()); return this; }
@Override public BuffersBuffer get(final ByteBuffer dst) { get(dst, dst.position(), dst.remaining()); dst.position(dst.limit()); return this; }
@Override public byte get() { if (!hasRemaining()) { throw new BufferUnderflowException(); } return get(position++); }
@Override public byte get() { if (!hasRemaining()) { throw new BufferUnderflowException(); } return get(position++); }
@Override public byte get() { if (!hasRemaining()) { throw new BufferUnderflowException(); } return get(position++); }
@Override public byte get() { if (!hasRemaining()) { throw new BufferUnderflowException(); } return get(position++); }
@Override public byte get() { if (!hasRemaining()) { throw new BufferUnderflowException(); } return get(position++); }
@Override public byte get() { if (!hasRemaining()) { throw new BufferUnderflowException(); } return get(position++); }
@Override public byte get() { if (!hasRemaining()) { throw new BufferUnderflowException(); } return get(position++); }
@Override public byte get() { if (!hasRemaining()) { throw new BufferUnderflowException(); } return get(position++); }
@Override public byte get() { if (!hasRemaining()) { throw new BufferUnderflowException(); } return get(position++); }
@Test public void testBulkByteBufferGetWithEmptyBuffers() throws Exception { BuffersBuffer b = BuffersBuffer.create(mm); b.append(Buffers.wrap(mm, "Hello ")); b.append(BuffersBuffer.create(mm)); b.append(Buffers.wrap(mm, "world!")); ByteBuffer buffer = ByteBuffer.allocate(12); b.get(buffer); buffer.flip(); assertEquals("Hello world!", Charsets.getCharsetDecoder(Charsets.UTF8_CHARSET).decode(buffer).toString()); }
@Test public void testBulkArrayGetWithEmptyBuffers() throws Exception { BuffersBuffer b = BuffersBuffer.create(mm); b.append(Buffers.wrap(mm, "Hello ")); b.append(BuffersBuffer.create(mm)); b.append(Buffers.wrap(mm, "world!")); byte[] bytes = new byte[12]; b.get(bytes); assertEquals("Hello world!", new String(bytes)); }