Package com.biglybt.pif.network
Interface Transport
-
- All Known Implementing Classes:
TransportImpl
public interface Transport
Represents an underlying network transport.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.
-
-
-
Method Detail
-
read
long read(java.nio.ByteBuffer[] buffers, int array_offset, int length) throws java.io.IOException
Read data from the transport into the given buffers. NOTE: Works like ScatteringByteChannel.- 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
long write(java.nio.ByteBuffer[] buffers, int array_offset, int length) throws java.io.IOException
Write data to the transport from the given buffers. NOTE: Works like GatheringByteChannel.- 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
-
setFilter
void setFilter(TransportFilter filter) throws java.io.IOException
- Throws:
java.io.IOException
- Since:
- 3.0.5.3
-
-