Package jadex.binary
Class StreamDecodingContext
- java.lang.Object
-
- jadex.binary.AbstractDecodingContext
-
- jadex.binary.StreamDecodingContext
-
- All Implemented Interfaces:
IDecodingContext
,IUserContextContainer
- Direct Known Subclasses:
FramingStreamDecodingContext
public class StreamDecodingContext extends AbstractDecodingContext
Context for decoding a binary-encoded object.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jadex.binary.AbstractDecodingContext
AbstractDecodingContext.IVersionedHandler, AbstractDecodingContext.VersionedHandler2, AbstractDecodingContext.VersionedHandler3, AbstractDecodingContext.VersionedHandler4
-
-
Field Summary
Fields Modifier and Type Field Description protected java.io.InputStream
is
The stream being decoded.protected int
offset
Current offset marker-
Fields inherited from class jadex.binary.AbstractDecodingContext
classloader, classnamepool, config, currentclassname, decoderhandlers, errorreporter, knownobjects, lastobject, postprocessors, stringpool, usercontext, versionedhandler
-
-
Constructor Summary
Constructors Constructor Description StreamDecodingContext(java.io.InputStream is, java.util.List<IDecoderHandler> decoderhandlers, java.util.List<ITraverseProcessor> postprocessors, java.lang.Object usercontext, java.lang.ClassLoader classloader, IErrorReporter errorreporter, SerializationConfig config)
Creates a new DecodingContext.StreamDecodingContext(java.io.InputStream is, java.util.List<IDecoderHandler> decoderhandlers, java.util.List<ITraverseProcessor> postprocessors, java.lang.Object usercontext, java.lang.ClassLoader classloader, IErrorReporter errorreporter, SerializationConfig config, int offset)
Creates a new DecodingContext with specific offset.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getCurrentOffset()
Returns the current offset of the decoding process for debugging.byte[]
read(byte[] array)
Reads a number of bytes from the buffer and fills the array.byte[]
read(byte[] array, int woffset, int wlength)
Reads a number of bytes from the buffer and fills the array.byte[]
read(int count)
Reads a number of bytes from the buffer.byte
readByte()
Reads a byte from the buffer.-
Methods inherited from class jadex.binary.AbstractDecodingContext
createObjectId, getClassloader, getCurrentClassName, getDecoderHandlers, getErrorReporter, getLastObject, getObjectForId, getObjectId, getPostProcessors, getUserContext, pooledRead, readBoolean, readClassname, readSignedVarInt, readString, readVarInt, setCurrentClassName, setLastObject, setObjectForId, setVersion, startObjectFrame, startObjectFrame, stopObjectFrame
-
-
-
-
Constructor Detail
-
StreamDecodingContext
public StreamDecodingContext(java.io.InputStream is, java.util.List<IDecoderHandler> decoderhandlers, java.util.List<ITraverseProcessor> postprocessors, java.lang.Object usercontext, java.lang.ClassLoader classloader, IErrorReporter errorreporter, SerializationConfig config)
Creates a new DecodingContext.- Parameters:
classloader
- The classloader.content
- The content being decoded.
-
StreamDecodingContext
public StreamDecodingContext(java.io.InputStream is, java.util.List<IDecoderHandler> decoderhandlers, java.util.List<ITraverseProcessor> postprocessors, java.lang.Object usercontext, java.lang.ClassLoader classloader, IErrorReporter errorreporter, SerializationConfig config, int offset)
Creates a new DecodingContext with specific offset.- Parameters:
content
- The content being decoded.offset
- The offset.
-
-
Method Detail
-
readByte
public byte readByte()
Reads a byte from the buffer.- Returns:
- A byte.
-
read
public byte[] read(int count)
Reads a number of bytes from the buffer.- Specified by:
read
in classAbstractDecodingContext
- Parameters:
count
- Number of bytes.- Returns:
- Byte array with the bytes.
-
read
public byte[] read(byte[] array)
Reads a number of bytes from the buffer and fills the array.- Specified by:
read
in interfaceIDecodingContext
- Specified by:
read
in classAbstractDecodingContext
- Parameters:
array
- The byte array.- Returns:
- The byte array for convenience.
-
read
public byte[] read(byte[] array, int woffset, int wlength)
Reads a number of bytes from the buffer and fills the array.- Specified by:
read
in classAbstractDecodingContext
- Parameters:
array
- The byte array.woffset
- write offset.wlength
- length to read.- Returns:
- The byte array for convenience.
-
getCurrentOffset
public int getCurrentOffset()
Returns the current offset of the decoding process for debugging.- Returns:
- Current offset.
-
-