Package jadex.binary
Class SBinarySerializer
- java.lang.Object
- 
- jadex.binary.SBinarySerializer
 
- 
 public class SBinarySerializer extends java.lang.ObjectObject serializer for encoding to and decoding from a compact binary format.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description protected static classSBinarySerializer.BinaryWriteTraverserTraverser for writing.
 - 
Field SummaryFields Modifier and Type Field Description static java.util.List<IDecoderHandler>DECODER_HANDLERSHandlers for decoding.static java.util.List<ITraverseProcessor>ENCODER_HANDLERSHandlers for encoding.protected static byteMAGIC_BYTEThe magic byte identifying it as a binary serializer 2+ stream.protected static java.lang.StringNULL_MARKERMarker for null valuesprotected static java.lang.StringREFERENCE_MARKERMarker for referencesprotected static intVERSIONSerializer version
 - 
Constructor SummaryConstructors Constructor Description SBinarySerializer()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.ObjectdecodeObject(IDecodingContext context)Helper method for decoding an object (used for recursion).protected static java.lang.ObjectdecodeRawObject(java.lang.Class<?> clazz, IDecodingContext context)Method for decoding a raw object where the class is known.static java.lang.ObjectreadObjectFromByteArray(byte[] val, java.util.List<ITraverseProcessor> postprocessors, java.lang.Object usercontext, java.lang.ClassLoader classloader, IErrorReporter errorreporter)Convert a byte array to an object.static java.lang.ObjectreadObjectFromDataInput(java.io.DataInput di, java.util.List<ITraverseProcessor> postprocessors, java.lang.Object usercontext, java.lang.ClassLoader classloader, IErrorReporter errorreporter, SerializationConfig config)Convert a byte array to an object.static java.lang.ObjectreadObjectFromFramedStream(java.io.InputStream is, java.util.List<ITraverseProcessor> postprocessors, java.lang.Object usercontext, java.lang.ClassLoader classloader, IErrorReporter errorreporter, SerializationConfig config)Convert a byte array to an object with framing support.static java.lang.ObjectreadObjectFromStream(java.io.InputStream is, java.lang.ClassLoader classloader)Convert a byte array to an object.static java.lang.ObjectreadObjectFromStream(java.io.InputStream is, java.util.List<ITraverseProcessor> postprocessors, java.lang.Object usercontext, java.lang.ClassLoader classloader, IErrorReporter errorreporter, SerializationConfig config)Convert a byte array to an object.static java.lang.ObjectreadObjectFromStream(java.io.InputStream is, java.util.List<ITraverseProcessor> postprocessors, java.lang.Object usercontext, java.lang.ClassLoader classloader, IErrorReporter errorreporter, SerializationConfig config, java.util.List<IDecoderHandler> decoders)Convert a byte array to an object.static byte[]writeObjectToByteArray(java.lang.Object val, java.lang.ClassLoader classloader)Convert an object to an encoded byte array.static longwriteObjectToDataOutput(java.io.DataOutput dato, java.lang.Object val, java.lang.ClassLoader classloader)Convert an object to an encoded byte array.static longwriteObjectToDataOutput(java.io.DataOutput dato, java.lang.Object val, java.util.List<ITraverseProcessor> preprocessors, java.lang.Object usercontext, java.lang.ClassLoader classloader, SerializationConfig config)Convert an object to an encoded byte array.static longwriteObjectToDataOutput(java.io.DataOutput dato, java.lang.Object val, java.util.List<ITraverseProcessor> preprocessors, java.util.List<ITraverseProcessor> encoderhandlers, java.lang.Object usercontext, java.lang.ClassLoader classloader, SerializationConfig config)Convert an object to an encoded byte array.static byte[]writeObjectToFramedArray(java.lang.Object val, java.lang.ClassLoader classloader)Convert an object to an encoded byte array with framing support.static byte[]writeObjectToFramedArray(java.lang.Object val, java.util.List<ITraverseProcessor> preprocessors, java.util.List<ITraverseProcessor> encoderhandlers, java.lang.Object usercontext, java.lang.ClassLoader classloader, SerializationConfig config)Convert an object to an encoded byte array with framing support.static longwriteObjectToStream(java.io.OutputStream os, java.lang.Object val, java.lang.ClassLoader classloader)Convert an object to an encoded byte array.static longwriteObjectToStream(java.io.OutputStream os, java.lang.Object val, java.util.List<ITraverseProcessor> preprocessors, java.lang.Object usercontext, java.lang.ClassLoader classloader)Convert an object to an encoded byte array.static longwriteObjectToStream(java.io.OutputStream os, java.lang.Object val, java.util.List<ITraverseProcessor> preprocessors, java.util.List<ITraverseProcessor> encoderhandlers, java.lang.Object usercontext, java.lang.ClassLoader classloader, SerializationConfig config)Convert an object to an encoded byte array.
 
- 
- 
- 
Field Detail- 
MAGIC_BYTEprotected static final byte MAGIC_BYTE The magic byte identifying it as a binary serializer 2+ stream.- See Also:
- Constant Field Values
 
 - 
VERSIONprotected static final int VERSION Serializer version- See Also:
- Constant Field Values
 
 - 
NULL_MARKERprotected static final java.lang.String NULL_MARKER Marker for null values- See Also:
- Constant Field Values
 
 - 
REFERENCE_MARKERprotected static final java.lang.String REFERENCE_MARKER Marker for references- See Also:
- Constant Field Values
 
 - 
ENCODER_HANDLERSpublic static final java.util.List<ITraverseProcessor> ENCODER_HANDLERS Handlers for encoding.
 - 
DECODER_HANDLERSpublic static final java.util.List<IDecoderHandler> DECODER_HANDLERS Handlers for decoding.
 
- 
 - 
Method Detail- 
writeObjectToByteArraypublic static byte[] writeObjectToByteArray(java.lang.Object val, java.lang.ClassLoader classloader)Convert an object to an encoded byte array.- Parameters:
- val- The object being encoded.
- preprocessors- List of processors called before the object is encoded, may be null.
- usercontext- A user context, may be null.
- classloader- The class loader used.
- Returns:
- Encoded byte array.
 
 - 
writeObjectToStreampublic static long writeObjectToStream(java.io.OutputStream os, java.lang.Object val, java.lang.ClassLoader classloader)Convert an object to an encoded byte array.- Parameters:
- val- The object being encoded.
- preprocessors- List of processors called before the object is encoded, may be null.
- usercontext- A user context, may be null.
- classloader- The class loader used.
- Returns:
- Bytes written.
 
 - 
writeObjectToStreampublic static long writeObjectToStream(java.io.OutputStream os, java.lang.Object val, java.util.List<ITraverseProcessor> preprocessors, java.lang.Object usercontext, java.lang.ClassLoader classloader)Convert an object to an encoded byte array.- Parameters:
- val- The object being encoded.
- preprocessors- List of processors called before the object is encoded, may be null.
- usercontext- A user context, may be null.
- classloader- The class loader used.
- Returns:
- Bytes written.
 
 - 
writeObjectToStreampublic static long writeObjectToStream(java.io.OutputStream os, java.lang.Object val, java.util.List<ITraverseProcessor> preprocessors, java.util.List<ITraverseProcessor> encoderhandlers, java.lang.Object usercontext, java.lang.ClassLoader classloader, SerializationConfig config)Convert an object to an encoded byte array.- Parameters:
- val- The object being encoded.
- preprocessors- List of processors called before the object is encoded, may be null.
- usercontext- A user context, may be null.
- classloader- The class loader used.
- Returns:
- Bytes written.
 
 - 
writeObjectToFramedArraypublic static byte[] writeObjectToFramedArray(java.lang.Object val, java.lang.ClassLoader classloader)Convert an object to an encoded byte array with framing support.- Parameters:
- val- The object being encoded.
- preprocessors- List of processors called before the object is encoded, may be null.
- usercontext- A user context, may be null.
- classloader- The class loader used.
- Returns:
- Bytes written.
 
 - 
writeObjectToFramedArraypublic static byte[] writeObjectToFramedArray(java.lang.Object val, java.util.List<ITraverseProcessor> preprocessors, java.util.List<ITraverseProcessor> encoderhandlers, java.lang.Object usercontext, java.lang.ClassLoader classloader, SerializationConfig config)Convert an object to an encoded byte array with framing support.- Parameters:
- val- The object being encoded.
- preprocessors- List of processors called before the object is encoded, may be null.
- usercontext- A user context, may be null.
- classloader- The class loader used.
- Returns:
- Bytes written.
 
 - 
writeObjectToDataOutputpublic static long writeObjectToDataOutput(java.io.DataOutput dato, java.lang.Object val, java.lang.ClassLoader classloader)Convert an object to an encoded byte array.- Parameters:
- val- The object being encoded.
- preprocessors- List of processors called before the object is encoded, may be null.
- usercontext- A user context, may be null.
- classloader- The class loader used.
- Returns:
- Bytes written.
 
 - 
writeObjectToDataOutputpublic static long writeObjectToDataOutput(java.io.DataOutput dato, java.lang.Object val, java.util.List<ITraverseProcessor> preprocessors, java.lang.Object usercontext, java.lang.ClassLoader classloader, SerializationConfig config)Convert an object to an encoded byte array.- Parameters:
- val- The object being encoded.
- preprocessors- List of processors called before the object is encoded, may be null.
- usercontext- A user context, may be null.
- classloader- The class loader used.
- Returns:
- Bytes written.
 
 - 
writeObjectToDataOutputpublic static long writeObjectToDataOutput(java.io.DataOutput dato, java.lang.Object val, java.util.List<ITraverseProcessor> preprocessors, java.util.List<ITraverseProcessor> encoderhandlers, java.lang.Object usercontext, java.lang.ClassLoader classloader, SerializationConfig config)Convert an object to an encoded byte array.- Parameters:
- val- The object being encoded.
- preprocessors- List of processors called before the object is encoded, may be null.
- usercontext- A user context, may be null.
- classloader- The class loader used.
- Returns:
- Bytes written.
 
 - 
readObjectFromByteArraypublic static java.lang.Object readObjectFromByteArray(byte[] val, java.util.List<ITraverseProcessor> postprocessors, java.lang.Object usercontext, java.lang.ClassLoader classloader, IErrorReporter errorreporter)Convert a byte array to an object.- Parameters:
- val- The byte array.
- usercontext- A user context, may be null.
- classloader- The class loader.
- errorreporter- The error reporter, may be null in which case the default reporter is used.
- Returns:
- The decoded object.
 
 - 
readObjectFromStreampublic static java.lang.Object readObjectFromStream(java.io.InputStream is, java.lang.ClassLoader classloader)Convert a byte array to an object.- Parameters:
- val- The byte array.
- usercontext- A user context, may be null.
- classloader- The class loader.
- errorreporter- The error reporter, may be null in which case the default reporter is used.
- Returns:
- The decoded object.
 
 - 
readObjectFromStreampublic static java.lang.Object readObjectFromStream(java.io.InputStream is, java.util.List<ITraverseProcessor> postprocessors, java.lang.Object usercontext, java.lang.ClassLoader classloader, IErrorReporter errorreporter, SerializationConfig config)Convert a byte array to an object.- Parameters:
- val- The byte array.
- usercontext- A user context, may be null.
- classloader- The class loader.
- errorreporter- The error reporter, may be null in which case the default reporter is used.
- Returns:
- The decoded object.
 
 - 
readObjectFromStreampublic static java.lang.Object readObjectFromStream(java.io.InputStream is, java.util.List<ITraverseProcessor> postprocessors, java.lang.Object usercontext, java.lang.ClassLoader classloader, IErrorReporter errorreporter, SerializationConfig config, java.util.List<IDecoderHandler> decoders)Convert a byte array to an object.- Parameters:
- val- The byte array.
- usercontext- A user context, may be null.
- classloader- The class loader.
- errorreporter- The error reporter, may be null in which case the default reporter is used.
- Returns:
- The decoded object.
 
 - 
readObjectFromFramedStreampublic static java.lang.Object readObjectFromFramedStream(java.io.InputStream is, java.util.List<ITraverseProcessor> postprocessors, java.lang.Object usercontext, java.lang.ClassLoader classloader, IErrorReporter errorreporter, SerializationConfig config)Convert a byte array to an object with framing support.- Parameters:
- val- The byte array.
- usercontext- A user context, may be null.
- classloader- The class loader.
- errorreporter- The error reporter, may be null in which case the default reporter is used.
- Returns:
- The decoded object.
 
 - 
readObjectFromDataInputpublic static java.lang.Object readObjectFromDataInput(java.io.DataInput di, java.util.List<ITraverseProcessor> postprocessors, java.lang.Object usercontext, java.lang.ClassLoader classloader, IErrorReporter errorreporter, SerializationConfig config)Convert a byte array to an object.- Parameters:
- val- The byte array.
- usercontext- A user context, may be null.
- classloader- The class loader.
- errorreporter- The error reporter, may be null in which case the default reporter is used.
- Returns:
- The decoded object.
 
 - 
decodeObjectpublic static java.lang.Object decodeObject(IDecodingContext context) Helper method for decoding an object (used for recursion).- Parameters:
- context- The decoding context.
- Returns:
- Decoded object.
 
 - 
decodeRawObjectprotected static java.lang.Object decodeRawObject(java.lang.Class<?> clazz, IDecodingContext context)Method for decoding a raw object where the class is known.- Parameters:
- clazz- The object's class.
- context- The decoding context.
- Returns:
- Decoded object.
 
 
- 
 
-