public class CommandDecoder extends AbstractStreamDecoder<Command,MasterProcessCommand,SegmentType>
AbstractStreamDecoder.BufferedStream, AbstractStreamDecoder.MalformedFrameException, AbstractStreamDecoder.Memento, AbstractStreamDecoder.Segment, AbstractStreamDecoder.StreamReadStatus
BUFFER_SIZE
Constructor and Description |
---|
CommandDecoder(ReadableByteChannel channel,
ForkNodeArguments arguments) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected void |
debugStream(byte[] array,
int position,
int remaining) |
Command |
decode(AbstractStreamDecoder.Memento memento) |
protected byte[] |
getEncodedMagicNumber() |
protected SegmentType[] |
nextSegmentType(MasterProcessCommand commandType) |
protected Command |
toMessage(MasterProcessCommand commandType,
AbstractStreamDecoder.Memento memento) |
checkArguments, checkDelimiter, checkHeader, getArguments, printRemainingStream, read, readByte, readCharset, readInt, readInteger, readLong, readLongPrivate, readMessageType, readSegment, readString
public CommandDecoder(@Nonnull ReadableByteChannel channel, @Nonnull ForkNodeArguments arguments)
public Command decode(@Nonnull AbstractStreamDecoder.Memento memento) throws IOException, MalformedChannelException
decode
in class AbstractStreamDecoder<Command,MasterProcessCommand,SegmentType>
IOException
MalformedChannelException
@Nonnull protected final byte[] getEncodedMagicNumber()
getEncodedMagicNumber
in class AbstractStreamDecoder<Command,MasterProcessCommand,SegmentType>
@Nonnull protected SegmentType[] nextSegmentType(@Nonnull MasterProcessCommand commandType)
nextSegmentType
in class AbstractStreamDecoder<Command,MasterProcessCommand,SegmentType>
@Nonnull protected Command toMessage(@Nonnull MasterProcessCommand commandType, @Nonnull AbstractStreamDecoder.Memento memento) throws AbstractStreamDecoder.MalformedFrameException
toMessage
in class AbstractStreamDecoder<Command,MasterProcessCommand,SegmentType>
AbstractStreamDecoder.MalformedFrameException
protected void debugStream(byte[] array, int position, int remaining)
debugStream
in class AbstractStreamDecoder<Command,MasterProcessCommand,SegmentType>
public void close() throws IOException
IOException
Copyright © 2004–2023 The Apache Software Foundation. All rights reserved.