Class SocketChannelReader

java.lang.Object
com.sun.corba.ee.impl.transport.SocketChannelReader

public class SocketChannelReader extends Object
  • Field Details

    • orb

      private ORB orb
  • Constructor Details

    • SocketChannelReader

      public SocketChannelReader(ORB orb)
  • Method Details

    • read

      public ByteBuffer read(SocketChannel channel, ByteBuffer previouslyReadData, int minNeeded) throws IOException
      Reads all currently available data from the socket channel, appending it to any data left from a previous read.
      Parameters:
      channel - the channel from which to read
      previouslyReadData - the old data to read; note: all data up to the limit is considered valid.
      minNeeded - the minimum number of bytes that should be present in the buffer before returning
      Returns:
      a buffer containing all old data, with all newly available data appended to it.
      Throws:
      IOException - if an error occurs while reading from the channel.
    • expandBuffer

      private ByteBuffer expandBuffer(ByteBuffer byteBuffer)
    • haveFilledBuffer

      private boolean haveFilledBuffer(ByteBuffer byteBuffer)
    • prepareToAppendTo

      private ByteBuffer prepareToAppendTo(ByteBuffer byteBuffer)
    • reallocateBuffer

      private ByteBuffer reallocateBuffer(ByteBuffer byteBuffer)
    • allocateBuffer

      private ByteBuffer allocateBuffer()