public class Rlp extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static class |
Rlp.LList
The type L list.
|
| 限定符和类型 | 字段和说明 |
|---|---|
static byte[] |
EMPTY_ELEMENT_RLP
The constant EMPTY_ELEMENT_RLP.
|
| 构造器和说明 |
|---|
Rlp() |
| 限定符和类型 | 方法和说明 |
|---|---|
static int |
calcElementPrefixSize(byte[] srcData)
Calc element prefix size int.
|
static RlpList |
decode2(byte[] msgData)
Parse wire byte[] message into RLP elements
|
static RlpElement |
decode2OneItem(byte[] msgData,
int startPos)
Decode 2 one item rlp element.
|
static BigInteger |
decodeBigInteger(byte[] data,
int index)
Decode big integer big integer.
|
static byte[] |
decodeByteArray(byte[] data,
int index) |
static int |
decodeInt(byte[] data,
int index)
Decode int int.
|
static Rlp.LList |
decodeLazyList(byte[] data)
Decode lazy list l list.
|
static Rlp.LList |
decodeLazyList(byte[] data,
int index,
int length)
Decode lazy list l list.
|
static long |
decodeLong(byte[] data,
int index) |
static RlpList |
decodeMessage(byte[] msgData) |
static RlpList |
decodeResponse(byte[] msgData) |
static String |
decodeStringItem(byte[] data,
int index) |
static byte[] |
encodeBigInteger(BigInteger srcBigInteger)
Encode big integer byte [ ].
|
static byte[] |
encodeByte(byte data)
Encode byte byte [ ].
|
static byte[] |
encodeElement(byte[] srcData)
Encode element byte [ ].
|
static byte[] |
encodeInt(int intData)
Encode int byte [ ].
|
static byte[] |
encodeLength(int length,
int offset)
Integer limitation goes up to 2^31-1 so length can never be bigger than MAX_ITEM_LENGTH
|
static byte[] |
encodeList(byte[]... elements)
Encode list byte [ ].
|
static byte[] |
encodeList(List<byte[]> elements)
Encode list byte [ ].
|
static byte[] |
encodeListHeader(int size)
Encode list header byte [ ].
|
static byte[] |
encodeLong(long longData)
Encode long byte [ ].
|
static byte[] |
encodeLongElementHeader(int length)
Encode long element header byte [ ].
|
static byte[] |
encodeShort(short shortData)
Encode short byte [ ].
|
static byte[] |
encodeString(String srcString)
Encode string byte [ ].
|
static byte |
getCommandCode(byte[] data)
Gets command code.
|
static int |
getFirstListElement(byte[] data,
int index)
Gets first list element.
|
static int |
getNextElementIndex(byte[] data,
int index)
Gets next element index.
|
public static final byte[] EMPTY_ELEMENT_RLP
public static int decodeInt(byte[] data,
int index)
data - the dataindex - the indexpublic static long decodeLong(byte[] data,
int index)
data - index - public static String decodeStringItem(byte[] data, int index)
data - index - public static BigInteger decodeBigInteger(byte[] data, int index)
data - the dataindex - the indexpublic static byte[] decodeByteArray(byte[] data,
int index)
public static int getFirstListElement(byte[] data,
int index)
data - the dataindex - the indexpublic static int getNextElementIndex(byte[] data,
int index)
data - the dataindex - the indexpublic static byte getCommandCode(byte[] data)
data - the datapublic static RlpList decode2(byte[] msgData)
msgData - - raw RLP datapublic static RlpList decodeResponse(byte[] msgData)
public static RlpList decodeMessage(byte[] msgData)
public static RlpElement decode2OneItem(byte[] msgData, int startPos)
msgData - the msg datastartPos - the start pospublic static Rlp.LList decodeLazyList(byte[] data)
data - the datapublic static Rlp.LList decodeLazyList(byte[] data, int index, int length)
data - the dataindex - the poslength - the lengthpublic static byte[] encodeLength(int length,
int offset)
length - the lengthoffset - the offsetpublic static byte[] encodeByte(byte data)
data - the single byte datapublic static byte[] encodeShort(short shortData)
shortData - the single short datapublic static byte[] encodeInt(int intData)
intData - the single intpublic static byte[] encodeLong(long longData)
longData - the single longpublic static byte[] encodeString(String srcString)
srcString - the src stringpublic static byte[] encodeBigInteger(BigInteger srcBigInteger)
srcBigInteger - the src big integerpublic static byte[] encodeElement(byte[] srcData)
srcData - the src datapublic static int calcElementPrefixSize(byte[] srcData)
srcData - the src datapublic static byte[] encodeListHeader(int size)
size - the sizepublic static byte[] encodeLongElementHeader(int length)
length - the lengthpublic static byte[] encodeList(List<byte[]> elements)
elements - the elementspublic static byte[] encodeList(byte[]... elements)
elements - the elementsCopyright © 2022. All rights reserved.