Package com.norswap.nanoeth.rlp
Class RLPParsing
java.lang.Object
com.norswap.nanoeth.rlp.RLPParsing
public final class RLPParsing extends Object
Utilities to help parse protocol objects from a RLP layout.
-
Method Summary
Modifier and Type Method Description static int
getByte(RLP seq, int i)
Parses the i-th item of the sequence, which should be a byte array of size 1, into a unsigned byte.static byte[]
getBytes(RLP rlp)
Same asRLP.bytes()
but converts an (unchecked)IllegalRLPAccess
to a (checked)RLPParsingException
.static byte[]
getBytes(RLP seq, int i)
Retrieves the i-th item of the sequence, and verifies that it is a byte array with a valid size.static long
getInt64(RLP seq, int i)
Parses the i-th item of the sequence, which should be a 8-byte array, into a 64-bit integer.static RLP[]
getItems(RLP rlp)
Same asRLP.items()
but converts an (unchecked)IllegalRLPAccess
to a (checked)RLPParsingException
.
-
Method Details
-
getBytes
Same asRLP.bytes()
but converts an (unchecked)IllegalRLPAccess
to a (checked)RLPParsingException
.- Throws:
RLPParsingException
-
getItems
Same asRLP.items()
but converts an (unchecked)IllegalRLPAccess
to a (checked)RLPParsingException
.- Throws:
RLPParsingException
-
getByte
Parses the i-th item of the sequence, which should be a byte array of size 1, into a unsigned byte.- Throws:
RLPParsingException
-
getInt64
Parses the i-th item of the sequence, which should be a 8-byte array, into a 64-bit integer.- Throws:
RLPParsingException
-
getBytes
Retrieves the i-th item of the sequence, and verifies that it is a byte array with a valid size.- Throws:
RLPParsingException
-