Class TransportImpl

java.lang.Object
com.biglybt.pifimpl.local.network.TransportImpl
All Implemented Interfaces:
Transport

public class TransportImpl extends Object implements Transport
  • Field Details

  • Constructor Details

    • TransportImpl

      public TransportImpl(NetworkConnection core_network)
    • TransportImpl

      public TransportImpl(Transport core_transport)
  • Method Details

    • read

      public long read(ByteBuffer[] buffers, int array_offset, int length) throws IOException
      Description copied from interface: Transport
      Read data from the transport into the given buffers. NOTE: Works like ScatteringByteChannel.
      Specified by:
      read in interface Transport
      Parameters:
      buffers - into which bytes are to be placed
      array_offset - offset within the buffer array of the first buffer into which bytes are to be placed
      length - maximum number of buffers to be accessed
      Returns:
      number of bytes read
      Throws:
      IOException - on read error
    • write

      public long write(ByteBuffer[] buffers, int array_offset, int length) throws IOException
      Description copied from interface: Transport
      Write data to the transport from the given buffers. NOTE: Works like GatheringByteChannel.
      Specified by:
      write in interface Transport
      Parameters:
      buffers - from which bytes are to be retrieved
      array_offset - offset within the buffer array of the first buffer from which bytes are to be retrieved
      length - maximum number of buffers to be accessed
      Returns:
      number of bytes written
      Throws:
      IOException - on write error
    • coreTransport

      public Transport coreTransport() throws IOException
      Throws:
      IOException
    • setFilter

      public void setFilter(TransportFilter filter) throws IOException
      Specified by:
      setFilter in interface Transport
      Throws:
      IOException
    • isEncrypted

      public boolean isEncrypted()
      Specified by:
      isEncrypted in interface Transport