public class FrameBuilder extends Object
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.Modifier and Type | Field and Description |
---|---|
protected ByteBuffer |
applicationBuffer |
protected ReadableByteChannel |
channel |
Constructor and Description |
---|
FrameBuilder(ReadableByteChannel channel,
ByteBuffer buffer) |
Modifier and Type | Method and Description |
---|---|
boolean |
isUnderflowHandlingEnabled() |
Frame |
readFrame()
Read a frame from the network.
|
protected boolean |
somethingToRead()
Tells whether there's something to read in the application buffer or not.
|
protected final ReadableByteChannel channel
protected final ByteBuffer applicationBuffer
public FrameBuilder(ReadableByteChannel channel, ByteBuffer buffer)
public Frame readFrame() throws IOException
IOException
Frame.readFrom(DataInputStream)
protected boolean somethingToRead() throws IOException
IOException
public boolean isUnderflowHandlingEnabled()
Copyright © 2022 VMware, Inc. or its affiliates.. All rights reserved.