|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.thrift.EncodingUtils
public class EncodingUtils
Utility methods for use when encoding/decoding raw data as byte arrays.
| Constructor Summary | |
|---|---|
EncodingUtils()
|
|
| Method Summary | |
|---|---|
static int |
decodeBigEndian(byte[] buf)
Decode a series of 4 bytes from buf, starting at position 0,
and interpret them as an integer. |
static int |
decodeBigEndian(byte[] buf,
int offset)
Decode a series of 4 bytes from buf, start at
offset, and interpret them as an integer. |
static void |
encodeBigEndian(int integer,
byte[] buf)
Encode integer as a series of 4 bytes into buf
starting at position 0 within that buffer. |
static void |
encodeBigEndian(int integer,
byte[] buf,
int offset)
Encode integer as a series of 4 bytes into buf
starting at position offset. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EncodingUtils()
| Method Detail |
|---|
public static final void encodeBigEndian(int integer,
byte[] buf)
integer as a series of 4 bytes into buf
starting at position 0 within that buffer.
integer - The integer to encode.buf - The buffer to write to.
public static final void encodeBigEndian(int integer,
byte[] buf,
int offset)
integer as a series of 4 bytes into buf
starting at position offset.
integer - The integer to encode.buf - The buffer to write to.offset - The offset within buf to start the encoding.public static final int decodeBigEndian(byte[] buf)
buf, starting at position 0,
and interpret them as an integer.
buf - The buffer to read from.
public static final int decodeBigEndian(byte[] buf,
int offset)
buf, start at
offset, and interpret them as an integer.
buf - The buffer to read from.offset - The offset with buf to start the decoding.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||