public class BinaryReader
extends java.lang.Object
implements java.lang.AutoCloseable
| Constructor and Description |
|---|
BinaryReader(byte[] input) |
BinaryReader(java.io.InputStream stream) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
int |
getMark() |
int |
getPosition() |
void |
mark(int readlimit) |
void |
read(byte[] buffer) |
void |
read(byte[] buffer,
int index,
int length) |
boolean |
readBoolean() |
byte |
readByte() |
byte |
readByteKeepPosition() |
byte[] |
readBytes(int count) |
double |
readDouble() |
org.bouncycastle.math.ec.ECPoint |
readECPoint() |
byte[] |
readEncodedECPoint()
Tries to read an encoded EC point from the underlying stream.
|
float |
readFloat() |
int |
readInt() |
long |
readInt64()
Reads a 64-bit signed integer from the underlying input stream.
|
java.math.BigInteger |
readPushBigInteger() |
byte[] |
readPushData()
Tries to read a PUSHDATA OpCode and the following data from the underlying byte stream.
|
int |
readPushInteger() |
java.lang.String |
readPushString() |
<T extends NeoSerializable> |
readSerializable(java.lang.Class<T> t) |
<T extends NeoSerializable> |
readSerializableList(java.lang.Class<T> t) |
<T extends NeoSerializable> |
readSerializableListVarBytes(java.lang.Class<T> t) |
short |
readShort() |
int |
readUInt16()
Reads a 16-bit unsigned integer from the underlying input stream.
|
static int |
readUInt16(byte[] bytes) |
long |
readUInt32()
Reads a 32-bit unsigned integer from the underlying input stream.
|
int |
readUnsignedByte() |
byte[] |
readVarBytes() |
byte[] |
readVarBytes(int max) |
long |
readVarInt() |
long |
readVarInt(long max) |
void |
reset() |
public BinaryReader(java.io.InputStream stream)
public BinaryReader(byte[] input)
public int getPosition()
public int getMark()
public void close()
throws java.io.IOException
close in interface java.lang.AutoCloseablejava.io.IOExceptionpublic void mark(int readlimit)
public void reset()
throws java.io.IOException
java.io.IOExceptionpublic void read(byte[] buffer)
throws java.io.IOException
java.io.IOExceptionpublic void read(byte[] buffer,
int index,
int length)
throws java.io.IOException
java.io.IOExceptionpublic boolean readBoolean()
throws java.io.IOException
java.io.IOExceptionpublic int readUnsignedByte()
throws java.io.IOException
java.io.IOExceptionpublic byte readByteKeepPosition()
throws java.io.IOException
java.io.IOExceptionpublic byte readByte()
throws java.io.IOException
java.io.IOExceptionpublic byte[] readBytes(int count)
throws java.io.IOException
java.io.IOExceptionpublic double readDouble()
throws java.io.IOException
java.io.IOExceptionpublic byte[] readEncodedECPoint()
throws DeserializationException
DeserializationException - if an the stream does not contain an EC point or an
IOException occurs.public org.bouncycastle.math.ec.ECPoint readECPoint()
throws java.io.IOException
java.io.IOExceptionpublic float readFloat()
throws java.io.IOException
java.io.IOExceptionpublic int readInt()
throws java.io.IOException
java.io.IOExceptionpublic int readUInt16()
throws java.io.IOException
Since Java does not support unsigned numeral types, the 16-bit short is represented by a int.
java.io.IOException - if an I/O exception occurs.public long readUInt32()
throws java.io.IOException
Since Java does not support unsigned numeral types, the unsigned integer is represented by a long.
java.io.IOException - if an I/O exception occurs.public long readInt64()
throws java.io.IOException
java.io.IOException - if an I/O exception occurs.public <T extends NeoSerializable> T readSerializable(java.lang.Class<T> t) throws DeserializationException
DeserializationExceptionpublic <T extends NeoSerializable> java.util.List<T> readSerializableListVarBytes(java.lang.Class<T> t) throws DeserializationException
DeserializationExceptionpublic <T extends NeoSerializable> java.util.List<T> readSerializableList(java.lang.Class<T> t) throws DeserializationException
DeserializationExceptionpublic short readShort()
throws java.io.IOException
java.io.IOExceptionpublic byte[] readVarBytes()
throws java.io.IOException
java.io.IOExceptionpublic byte[] readPushData()
throws DeserializationException
DeserializationException - if the sequence of data cannot be deserializedpublic byte[] readVarBytes(int max)
throws java.io.IOException
java.io.IOExceptionpublic long readVarInt()
throws java.io.IOException
java.io.IOExceptionpublic long readVarInt(long max)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String readPushString()
throws DeserializationException
DeserializationExceptionpublic int readPushInteger()
throws DeserializationException
DeserializationExceptionpublic java.math.BigInteger readPushBigInteger()
throws DeserializationException
DeserializationExceptionpublic static int readUInt16(byte[] bytes)