public class DecodingContext extends Object
Constructor and Description |
---|
DecodingContext(byte[] content,
List<IDecoderHandler> postprocessors,
Object usercontext,
ClassLoader classloader,
IErrorReporter errorreporter)
Creates a new DecodingContext.
|
DecodingContext(byte[] content,
List<IDecoderHandler> postprocessors,
Object usercontext,
ClassLoader classloader,
IErrorReporter errorreporter,
int offset)
Creates a new DecodingContext with specific offset.
|
Modifier and Type | Method and Description |
---|---|
ByteBuffer |
getByteBuffer(int length)
Gets a ByteBuffer window of the content.
|
ClassLoader |
getClassloader()
Gets the classloader.
|
byte[] |
getContent()
Gets the content being decoded.
|
String |
getCurrentClassName()
Gets the current class name.
|
IErrorReporter |
getErrorReporter()
Gets the error reporter.
|
Map<Integer,Object> |
getKnownObjects()
Returns the known objects.
|
Object |
getLastObject()
Returns the last object decoded.
|
int |
getOffset()
Gets the current offset.
|
List<IDecoderHandler> |
getPostProcessors()
Returns the handlers used for post-processing.
|
Object |
getUserContext()
Returns the user context.
|
void |
incOffset(int val)
Increases the offset.
|
byte[] |
read(int count)
Reads a number of bytes from the buffer.
|
boolean |
readBoolean()
Reads a boolean value from the buffer.
|
String |
readClassname()
Helper method for decoding a class name.
|
long |
readSignedVarInt()
Helper method for decoding a signed variable-sized integer (VarInt).
|
String |
readString()
Helper method for decoding a string.
|
long |
readVarInt()
Helper method for decoding a variable-sized integer (VarInt).
|
void |
setLastObject(Object lastobject)
Sets the last object decoded.
|
public DecodingContext(byte[] content, List<IDecoderHandler> postprocessors, Object usercontext, ClassLoader classloader, IErrorReporter errorreporter)
classloader
- The classloader.content
- The content being decoded.public DecodingContext(byte[] content, List<IDecoderHandler> postprocessors, Object usercontext, ClassLoader classloader, IErrorReporter errorreporter, int offset)
content
- The content being decoded.offset
- The offset.public List<IDecoderHandler> getPostProcessors()
public Map<Integer,Object> getKnownObjects()
public Object getLastObject()
public Object getUserContext()
public void setLastObject(Object lastobject)
lastobject
- The last object decoded.public String getCurrentClassName()
public IErrorReporter getErrorReporter()
public void incOffset(int val)
val
- The value to increase the offset.public int getOffset()
offset
- The offset.public ClassLoader getClassloader()
public byte[] getContent()
public byte[] read(int count)
count
- Number of bytes.public boolean readBoolean()
public ByteBuffer getByteBuffer(int length)
length
- The length in bytes.public String readClassname()
public String readString()
public long readVarInt()
public long readSignedVarInt()
Copyright © 2013. All Rights Reserved.