Package jadex.binary
Class DataInputDecodingContext
java.lang.Object
jadex.binary.AbstractDecodingContext
jadex.binary.DataInputDecodingContext
- All Implemented Interfaces:
IDecodingContext
,jadex.common.transformation.traverser.IUserContextContainer
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
FieldsModifier and TypeFieldDescriptionprotected DataInput
The stream being decoded.protected int
Current offset markerFields inherited from class jadex.binary.AbstractDecodingContext
classloader, classnamepool, config, currentclassname, decoderhandlers, errorreporter, knownobjects, lastobject, postprocessors, stringpool, usercontext, versionedhandler
-
Constructor Summary
ConstructorsConstructorDescriptionDataInputDecodingContext
(DataInput di, List<IDecoderHandler> decoderhandlers, List<jadex.common.transformation.traverser.ITraverseProcessor> postprocessors, Object usercontext, ClassLoader classloader, jadex.common.transformation.traverser.IErrorReporter errorreporter, SerializationConfig config) Creates a new DecodingContext.DataInputDecodingContext
(DataInput di, List<IDecoderHandler> decoderhandlers, List<jadex.common.transformation.traverser.ITraverseProcessor> postprocessors, Object usercontext, ClassLoader classloader, jadex.common.transformation.traverser.IErrorReporter errorreporter, SerializationConfig config, int offset) Creates a new DecodingContext with specific offset. -
Method Summary
Modifier and TypeMethodDescriptionint
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
-
Field Details
-
di
The stream being decoded. -
offset
protected int offsetCurrent offset marker
-
-
Constructor Details
-
DataInputDecodingContext
public DataInputDecodingContext(DataInput di, List<IDecoderHandler> decoderhandlers, List<jadex.common.transformation.traverser.ITraverseProcessor> postprocessors, Object usercontext, ClassLoader classloader, jadex.common.transformation.traverser.IErrorReporter errorreporter, SerializationConfig config) Creates a new DecodingContext.- Parameters:
classloader
- The classloader.content
- The content being decoded.
-
DataInputDecodingContext
public DataInputDecodingContext(DataInput di, List<IDecoderHandler> decoderhandlers, List<jadex.common.transformation.traverser.ITraverseProcessor> postprocessors, Object usercontext, ClassLoader classloader, jadex.common.transformation.traverser.IErrorReporter errorreporter, SerializationConfig config, int offset) Creates a new DecodingContext with specific offset.- Parameters:
offset
- The offset.content
- The content being decoded.
-
-
Method Details
-
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.
-