Package com.rabbitmq.client.impl.nio
Class FrameBuilder
java.lang.Object
com.rabbitmq.client.impl.nio.FrameBuilder
- Direct Known Subclasses:
SslEngineFrameBuilder
Class to create AMQP frames from a
ReadableByteChannel
.
Supports partial frames: a frame can be read in several attempts
from the NioLoop
. This can happen when the channel won't
read any more bytes in the middle of a frame building. The state
of the outstanding frame is saved up, and the builder will
start where it left off when the NioLoop
comes back to
this connection.
This class is not thread safe.- Since:
- 4.4.0
-
Field Summary
-
Constructor Summary
ConstructorDescriptionFrameBuilder
(ReadableByteChannel channel, ByteBuffer buffer, int maxPayloadSize) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Read a frame from the network.protected boolean
Tells whether there's something to read in the application buffer or not.
-
Field Details
-
channel
-
applicationBuffer
-
-
Constructor Details
-
FrameBuilder
-
-
Method Details
-
readFrame
Read a frame from the network. This method returns null f a frame could not have been fully built from the network. The client must then retry later (typically when the channel notifies it has something to read).- Returns:
- a complete frame or null if a frame couldn't have been fully built
- Throws:
IOException
- See Also:
-
somethingToRead
Tells whether there's something to read in the application buffer or not. Tries to read from the network if necessary.- Returns:
- true if there's something to read in the application buffer
- Throws:
IOException
-
isUnderflowHandlingEnabled
public boolean isUnderflowHandlingEnabled()
-