M
- message objectMT
- enum describing the meaning of the messageST
- enum for segment typepublic abstract class AbstractStreamDecoder<M,MT extends Enum<MT>,ST extends Enum<ST>> extends Object implements AutoCloseable
Modifier and Type | Class and Description |
---|---|
class |
AbstractStreamDecoder.BufferedStream
This class avoids locking which gains the performance of this decoder.
|
static class |
AbstractStreamDecoder.MalformedFrameException |
class |
AbstractStreamDecoder.Memento |
static class |
AbstractStreamDecoder.Segment |
static class |
AbstractStreamDecoder.StreamReadStatus
Underflow - could not completely read out al bytes in one call.
|
Modifier and Type | Field and Description |
---|---|
static int |
BUFFER_SIZE |
Modifier | Constructor and Description |
---|---|
protected |
AbstractStreamDecoder(ReadableByteChannel channel,
ForkNodeArguments arguments,
Map<AbstractStreamDecoder.Segment,MT> messageTypes) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close
public static final int BUFFER_SIZE
protected AbstractStreamDecoder(@Nonnull ReadableByteChannel channel, @Nonnull ForkNodeArguments arguments, @Nonnull Map<AbstractStreamDecoder.Segment,MT> messageTypes)
public abstract M decode(@Nonnull AbstractStreamDecoder.Memento memento) throws MalformedChannelException, IOException
MalformedChannelException
IOException
@Nonnull protected abstract byte[] getEncodedMagicNumber()
@Nonnull protected abstract M toMessage(@Nonnull MT messageType, @Nonnull AbstractStreamDecoder.Memento memento) throws AbstractStreamDecoder.MalformedFrameException
@Nonnull protected final ForkNodeArguments getArguments()
protected void debugStream(byte[] array, int position, int remaining)
protected MT readMessageType(@Nonnull AbstractStreamDecoder.Memento memento) throws IOException, AbstractStreamDecoder.MalformedFrameException
@Nonnull protected AbstractStreamDecoder.Segment readSegment(@Nonnull AbstractStreamDecoder.Memento memento) throws IOException, AbstractStreamDecoder.MalformedFrameException
@Nonnull protected Charset readCharset(@Nonnull AbstractStreamDecoder.Memento memento) throws IOException, AbstractStreamDecoder.MalformedFrameException
protected String readString(@Nonnull AbstractStreamDecoder.Memento memento) throws IOException, AbstractStreamDecoder.MalformedFrameException
protected Integer readInteger(@Nonnull AbstractStreamDecoder.Memento memento) throws IOException, AbstractStreamDecoder.MalformedFrameException
protected byte readByte(@Nonnull AbstractStreamDecoder.Memento memento) throws IOException, AbstractStreamDecoder.MalformedFrameException
protected int readInt(@Nonnull AbstractStreamDecoder.Memento memento) throws IOException, AbstractStreamDecoder.MalformedFrameException
protected Long readLong(@Nonnull AbstractStreamDecoder.Memento memento) throws IOException, AbstractStreamDecoder.MalformedFrameException
protected long readLongPrivate(@Nonnull AbstractStreamDecoder.Memento memento) throws IOException, AbstractStreamDecoder.MalformedFrameException
protected final void checkDelimiter(AbstractStreamDecoder.Memento memento) throws AbstractStreamDecoder.MalformedFrameException
protected final void checkHeader(AbstractStreamDecoder.Memento memento) throws AbstractStreamDecoder.MalformedFrameException
protected void checkArguments(AbstractStreamDecoder.Memento memento, int expectedDataElements) throws AbstractStreamDecoder.MalformedFrameException
protected final void printRemainingStream(AbstractStreamDecoder.Memento memento)
memento
- current memento object@Nonnull protected AbstractStreamDecoder.StreamReadStatus read(@Nonnull AbstractStreamDecoder.Memento memento, int recommendedCount) throws IOException
IOException
Copyright © 2004–2024 The Apache Software Foundation. All rights reserved.