Package jadex.binary
Class FramingEncodingContext
- java.lang.Object
- 
- jadex.binary.AbstractEncodingContext
- 
- jadex.binary.FramingEncodingContext
 
 
- 
- All Implemented Interfaces:
- IEncodingContext,- IRootObjectContext,- IUserContextContainer
 
 public class FramingEncodingContext extends AbstractEncodingContext Encoding context with framing output.
- 
- 
Field SummaryFields Modifier and Type Field Description protected byte[]bufferThe buffer.protected java.util.Deque<Tuple2<java.lang.Integer,java.lang.Boolean>>framestackThe frame stack, buffer position and fixed size marker.- 
Fields inherited from class jadex.binary.AbstractEncodingContextclassidcache, classloader, classnamepool, ignorewriteclass, knownobjects, lastinputobject, nonanonclasscache, preprocessors, rootobject, stringpool, usercontext, writtenbytes
 
- 
 - 
Constructor SummaryConstructors Constructor Description FramingEncodingContext(java.lang.Object rootobject, java.lang.Object usercontext, java.util.List<ITraverseProcessor> preprocessors, java.lang.ClassLoader classloader, SerializationConfig config)Creates an encoding context.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidensureSpace(int requiredsize)Ensures sufficient space in buffer.voidstartObjectFrame(boolean fixedsize)Starts an object frame when using a context with framing support.voidstopObjectFrame()Stops an object frame when using a context with framing support.byte[]toByteArray()Returns the current data buffer, trimmed to size.voidwrite(byte[] b)Writes a byte array.voidwriteByte(byte b)Writes a byte.- 
Methods inherited from class jadex.binary.AbstractEncodingContextcreateObjectId, getClassLoader, getNonInnerClassCache, getObjectId, getPreprocessors, getRootObject, getUserContext, getWrittenBytes, isIgnoreNextClassWrite, pooledWrite, setIgnoreNextClassWrite, setInputObject, startObjectFrame, writeBoolean, writeClass, writeClassname, writeSignedVarInt, writeString, writeVarInt
 
- 
 
- 
- 
- 
Field Detail- 
bufferprotected byte[] buffer The buffer.
 - 
framestackprotected java.util.Deque<Tuple2<java.lang.Integer,java.lang.Boolean>> framestack The frame stack, buffer position and fixed size marker.
 
- 
 - 
Constructor Detail- 
FramingEncodingContextpublic FramingEncodingContext(java.lang.Object rootobject, java.lang.Object usercontext, java.util.List<ITraverseProcessor> preprocessors, java.lang.ClassLoader classloader, SerializationConfig config)Creates an encoding context.- Parameters:
- usercontext- A user context.
- preprocessors- The preprocessors.
- classloader- The classloader.
 
 
- 
 - 
Method Detail- 
startObjectFramepublic void startObjectFrame(boolean fixedsize) Starts an object frame when using a context with framing support.- Specified by:
- startObjectFramein interface- IEncodingContext
- Overrides:
- startObjectFramein class- AbstractEncodingContext
- Parameters:
- fixedsize- If true, use fixed-size (integer) framing. Set true if the object being framed is expected to be larger than 127 bytes (same type of object MUST use either fixed OR variable framing).
 
 - 
stopObjectFramepublic void stopObjectFrame() Stops an object frame when using a context with framing support.- Specified by:
- stopObjectFramein interface- IEncodingContext
- Overrides:
- stopObjectFramein class- AbstractEncodingContext
 
 - 
writeBytepublic void writeByte(byte b) Description copied from interface:IEncodingContextWrites a byte.- Parameters:
- b- The byte.
 
 - 
writepublic void write(byte[] b) Description copied from interface:IEncodingContextWrites a byte array.- Parameters:
- b- The byte array.
 
 - 
toByteArraypublic byte[] toByteArray() Returns the current data buffer, trimmed to size.- Returns:
- The buffer.
 
 - 
ensureSpaceprotected void ensureSpace(int requiredsize) Ensures sufficient space in buffer.- Parameters:
- requiredsize- Required space in buffer.
 
 
- 
 
-