Class TransportImpl
java.lang.Object
com.biglybt.pifimpl.local.network.TransportImpl
- All Implemented Interfaces:
Transport
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTransportImpl
(NetworkConnection core_network) TransportImpl
(Transport core_transport) -
Method Summary
Modifier and TypeMethodDescriptionboolean
long
read
(ByteBuffer[] buffers, int array_offset, int length) Read data from the transport into the given buffers.void
setFilter
(TransportFilter filter) long
write
(ByteBuffer[] buffers, int array_offset, int length) Write data to the transport from the given buffers.
-
Field Details
-
core_transport
-
core_network
-
-
Constructor Details
-
TransportImpl
-
TransportImpl
-
-
Method Details
-
read
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:
IOException
- on read error
-
write
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:
IOException
- on write error
-
coreTransport
- Throws:
IOException
-
setFilter
- Specified by:
setFilter
in interfaceTransport
- Throws:
IOException
-
isEncrypted
public boolean isEncrypted()- Specified by:
isEncrypted
in interfaceTransport
-