@Test public void testByteArrayConversion() { byte[] buffer = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; int length = buffer.length - 2; int offset = 1; TransferEvent event = new TransferEvent.Builder( session, res ).setDataBuffer( buffer, offset, length ).build(); ByteBuffer bb = event.getDataBuffer(); byte[] dst = new byte[bb.remaining()]; bb.get( dst ); byte[] expected = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 }; assertArrayEquals( expected, dst ); }
public ByteBuffer getDataBuffer() { return ( dataBuffer != null ) ? dataBuffer.asReadOnlyBuffer() : null; }
TransferEvent { public ByteBuffer getDataBuffer() { return ( dataBuffer != null ) ? dataBuffer.asReadOnlyBuffer() : null; } }
TransferEvent { public ByteBuffer getDataBuffer() { return ( dataBuffer != null ) ? dataBuffer.asReadOnlyBuffer() : null; } TransferEvent( Builder builder ); }
TransferEvent { public ByteBuffer getDataBuffer() { return ( dataBuffer != null ) ? dataBuffer.asReadOnlyBuffer() : null; } TransferEvent( Builder builder ); EventType getType(); RequestType getRequestType(); RepositorySystemSession getSession(); TransferResource getResource(); long getTransferredBytes(); ByteBuffer getDataBuffer(); int getDataLength(); Exception getException(); @Override String toString(); }
TransferEvent { public ByteBuffer getDataBuffer() { return ( dataBuffer != null ) ? dataBuffer.asReadOnlyBuffer() : null; } TransferEvent( Builder builder ); EventType getType(); RequestType getRequestType(); RepositorySystemSession getSession(); TransferResource getResource(); long getTransferredBytes(); ByteBuffer getDataBuffer(); int getDataLength(); Exception getException(); @Override String toString();  }