public class EncodingContext extends Object
| Constructor and Description |
|---|
EncodingContext(Object rootobject,
Object usercontext,
List<ITraverseProcessor> preprocessors,
ClassLoader classloader)
Creates an encoding context.
|
| Modifier and Type | Method and Description |
|---|---|
ByteBuffer |
getByteBuffer(int length)
Reserves a byte buffer on the stream.
|
byte[] |
getBytes()
Returns the encoded bytes.
|
ClassLoader |
getClassLoader()
Gets the classloader.
|
List<ITraverseProcessor> |
getPreprocessors()
Returns the preprocessors.
|
Object |
getRootObject()
Get the rootobject.
|
Object |
getUserContext()
Returns the user context.
|
void |
ignoreNextClassWrite()
Puts the context in a state where the next call to
writeClass is ignored.
|
void |
write(byte[] b)
Writes a byte array, appending it to the buffer.
|
void |
writeBoolean(boolean bool) |
void |
writeClass(Class clazz) |
int |
writeClassname(String name) |
void |
writeSignedVarInt(long value) |
void |
writeString(String string) |
void |
writeVarInt(long value) |
public EncodingContext(Object rootobject, Object usercontext, List<ITraverseProcessor> preprocessors, ClassLoader classloader)
usercontext - A user context.preprocessors - The preprocessors.classloader - The classloader.public byte[] getBytes()
public Object getRootObject()
public Object getUserContext()
public List<ITraverseProcessor> getPreprocessors()
public ClassLoader getClassLoader()
public void ignoreNextClassWrite()
public void write(byte[] b)
b - The byte array.public ByteBuffer getByteBuffer(int length)
public void writeBoolean(boolean bool)
bool - public void writeClass(Class clazz)
clazz - public int writeClassname(String name)
public void writeString(String string)
string - public void writeVarInt(long value)
value - public void writeSignedVarInt(long value)
value - Copyright © 2012. All Rights Reserved.