Class TransportImpl
- java.lang.Object
-
- com.biglybt.pifimpl.local.network.TransportImpl
-
-
Field Summary
Fields Modifier and Type Field Description private NetworkConnection
core_network
private Transport
core_transport
-
Constructor Summary
Constructors Constructor Description TransportImpl(NetworkConnection core_network)
TransportImpl(Transport core_transport)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Transport
coreTransport()
long
read(java.nio.ByteBuffer[] buffers, int array_offset, int length)
Read data from the transport into the given buffers.void
setFilter(TransportFilter filter)
long
write(java.nio.ByteBuffer[] buffers, int array_offset, int length)
Write data to the transport from the given buffers.
-
-
-
Field Detail
-
core_transport
private Transport core_transport
-
core_network
private NetworkConnection core_network
-
-
Constructor Detail
-
TransportImpl
public TransportImpl(NetworkConnection core_network)
-
TransportImpl
public TransportImpl(Transport core_transport)
-
-
Method Detail
-
read
public long read(java.nio.ByteBuffer[] buffers, int array_offset, int length) throws java.io.IOException
Description copied from interface:Transport
Read data from the transport into the given buffers. NOTE: Works like ScatteringByteChannel.- Specified by:
read
in interfaceTransport
- Parameters:
buffers
- into which bytes are to be placedarray_offset
- offset within the buffer array of the first buffer into which bytes are to be placedlength
- maximum number of buffers to be accessed- Returns:
- number of bytes read
- Throws:
java.io.IOException
- on read error
-
write
public long write(java.nio.ByteBuffer[] buffers, int array_offset, int length) throws java.io.IOException
Description copied from interface:Transport
Write data to the transport from the given buffers. NOTE: Works like GatheringByteChannel.- Specified by:
write
in interfaceTransport
- Parameters:
buffers
- from which bytes are to be retrievedarray_offset
- offset within the buffer array of the first buffer from which bytes are to be retrievedlength
- maximum number of buffers to be accessed- Returns:
- number of bytes written
- Throws:
java.io.IOException
- on write error
-
coreTransport
public Transport coreTransport() throws java.io.IOException
- Throws:
java.io.IOException
-
setFilter
public void setFilter(TransportFilter filter) throws java.io.IOException
-
-