public class DecodingContext extends AbstractDecodingContext
| Constructor and Description |
|---|
DecodingContext(byte[] content,
List<IDecoderHandler> decoderhandlers,
List<IDecoderHandler> postprocessors,
Object usercontext,
ClassLoader classloader,
IErrorReporter errorreporter)
Creates a new DecodingContext.
|
DecodingContext(byte[] content,
List<IDecoderHandler> decoderhandlers,
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.
|
byte[] |
getContent()
Gets the content being decoded.
|
int |
getOffset()
Gets the current offset.
|
void |
incOffset(int val)
Increases the offset.
|
byte[] |
read(byte[] array)
Reads a number of bytes from the buffer and fills the array.
|
byte[] |
read(int count)
Reads a number of bytes from the buffer.
|
boolean |
readBoolean()
Reads a boolean value from the buffer.
|
byte |
readByte()
Reads a byte 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).
|
getClassloader, getCurrentClassName, getDecoderHandlers, getErrorReporter, getKnownObjects, getLastObject, getPostProcessors, getUserContext, setLastObjectpublic DecodingContext(byte[] content,
List<IDecoderHandler> decoderhandlers,
List<IDecoderHandler> postprocessors,
Object usercontext,
ClassLoader classloader,
IErrorReporter errorreporter)
classloader - The classloader.content - The content being decoded.public DecodingContext(byte[] content,
List<IDecoderHandler> decoderhandlers,
List<IDecoderHandler> postprocessors,
Object usercontext,
ClassLoader classloader,
IErrorReporter errorreporter,
int offset)
content - The content being decoded.offset - The offset.public void incOffset(int val)
val - The value to increase the offset.public int getOffset()
offset - The offset.public byte[] getContent()
public byte readByte()
public byte[] read(int count)
count - Number of bytes.public byte[] read(byte[] array)
array - The byte array.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 © 2015. All Rights Reserved.