public abstract class RLPItem
extends java.lang.Object
index (inclusive) and
ending at endIndex (exclusive), representing a single item (either a string or list). Useful when decoding or
otherwise manipulating RLP items.
Created by Evo on 1/19/2017.| 限定符和类型 | 字段和说明 |
|---|---|
protected byte[] |
buffer |
int |
dataIndex |
int |
dataLength |
static RLPItem[] |
EMPTY_ARRAY |
int |
endIndex |
protected int |
index |
| 限定符和类型 | 方法和说明 |
|---|---|
java.math.BigDecimal |
asBigDecimal(int scale) |
java.math.BigInteger |
asBigInt() |
boolean |
asBoolean()
Wise man says only empty items are false.
|
byte |
asByte() |
char |
asChar()
Returns the char representation for this item.
|
double |
asDouble() |
float |
asFloat() |
int |
asInt() |
long |
asLong() |
short |
asShort() |
java.lang.String |
asString(int encoding) |
byte[] |
copyOfRange(int from,
int to) |
byte[] |
data() |
abstract RLPItem |
duplicate(RLPDecoder decoder)
Clones this object.
|
byte[] |
encoding() |
int |
encodingLength() |
boolean |
equals(java.lang.Object obj) |
int |
export(byte[] dest,
int destIndex) |
int |
exportData(byte[] dest,
int destIndex) |
int |
exportRange(int from,
int to,
byte[] dest,
int destIndex) |
int |
hashCode() |
abstract boolean |
isList() |
java.lang.String |
toString() |
java.lang.String |
toString(int encoding) |
DataType |
type() |
public static final RLPItem[] EMPTY_ARRAY
protected final byte[] buffer
protected final int index
public final transient int dataIndex
public final transient int dataLength
public final transient int endIndex
public final DataType type()
public abstract boolean isList()
public final int encodingLength()
public final byte[] encoding()
public final byte[] data()
public final byte[] copyOfRange(int from,
int to)
public final int export(byte[] dest,
int destIndex)
public final int exportData(byte[] dest,
int destIndex)
public final int exportRange(int from,
int to,
byte[] dest,
int destIndex)
public boolean asBoolean()
Integers.putByte(byte, byte[], int)public char asChar()
throws DecodeException
DecodeException - if this item is not interpretable as a charString.charAt(int)public java.lang.String asString(int encoding)
public byte asByte()
throws DecodeException
DecodeExceptionpublic short asShort()
throws DecodeException
DecodeExceptionpublic int asInt()
throws DecodeException
DecodeExceptionpublic long asLong()
throws DecodeException
DecodeExceptionpublic java.math.BigInteger asBigInt()
public float asFloat()
throws DecodeException
DecodeExceptionpublic double asDouble()
throws DecodeException
DecodeExceptionpublic java.math.BigDecimal asBigDecimal(int scale)
public abstract RLPItem duplicate(RLPDecoder decoder) throws DecodeException
decoder - either RLPDecoder.RLP_STRICT or RLPDecoder.RLP_LENIENTDecodeException - if an unexpected problem in decoding occurspublic final int hashCode()
hashCode 在类中 java.lang.ObjectArrays.hashCode(byte[])public final boolean equals(java.lang.Object obj)
equals 在类中 java.lang.Objectpublic java.lang.String toString()
toString 在类中 java.lang.Objectpublic java.lang.String toString(int encoding)