public class TProtocolUtil
extends java.lang.Object
| Constructor and Description |
|---|
TProtocolUtil() |
| Modifier and Type | Method and Description |
|---|---|
static TProtocolFactory |
guessProtocolFactory(byte[] data,
TProtocolFactory fallback)
Attempt to determine the protocol used to serialize some data.
|
static void |
setMaxSkipDepth(int depth)
Specifies the maximum recursive depth that the skip function will
traverse before throwing a TException.
|
static void |
skip(TProtocol prot,
byte type)
Skips over the next data element from the provided input TProtocol object.
|
static void |
skip(TProtocol prot,
byte type,
int maxDepth)
Skips over the next data element from the provided input TProtocol object.
|
public static void setMaxSkipDepth(int depth)
depth - the maximum recursive depth. A value of 2 would allow
the skip function to skip a structure or collection with basic children,
but it would not permit skipping a struct that had a field containing
a child struct. A value of 1 would only allow skipping of simple
types and empty structs/collections.public static void skip(TProtocol prot, byte type) throws TException
prot - the protocol object to read fromtype - the next value will be interpreted as this TType value.TExceptionpublic static void skip(TProtocol prot, byte type, int maxDepth) throws TException
prot - the protocol object to read fromtype - the next value will be interpreted as this TType value.maxDepth - this function will only skip complex objects to this
recursive depth, to prevent Java stack overflow.TExceptionpublic static TProtocolFactory guessProtocolFactory(byte[] data, TProtocolFactory fallback)
data - The serialized data to guess the protocol for.fallback - The TProtocol to return if no guess can be made.