Package com.sun.corba.ee.impl.transport
Class SocketChannelReader
java.lang.Object
com.sun.corba.ee.impl.transport.SocketChannelReader
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate ByteBuffer
private ByteBuffer
expandBuffer
(ByteBuffer byteBuffer) private boolean
haveFilledBuffer
(ByteBuffer byteBuffer) private ByteBuffer
prepareToAppendTo
(ByteBuffer byteBuffer) read
(SocketChannel channel, ByteBuffer previouslyReadData, int minNeeded) Reads all currently available data from the socket channel, appending it to any data left from a previous read.private ByteBuffer
reallocateBuffer
(ByteBuffer byteBuffer)
-
Field Details
-
orb
-
-
Constructor Details
-
SocketChannelReader
-
-
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 readpreviouslyReadData
- 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
-
haveFilledBuffer
-
prepareToAppendTo
-
reallocateBuffer
-
allocateBuffer
-