public class BinaryWriter
extends java.lang.Object
implements java.lang.AutoCloseable
| Constructor and Description |
|---|
BinaryWriter(java.io.OutputStream stream) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush() |
void |
write(byte[] buffer) |
void |
write(byte[] buffer,
int index,
int length) |
void |
writeBoolean(boolean v) |
void |
writeByte(byte v) |
void |
writeDouble(double v) |
void |
writeECPoint(org.bouncycastle.math.ec.ECPoint v) |
void |
writeFixedString(java.lang.String v,
int length) |
void |
writeFloat(float v) |
void |
writeInt32(int v) |
void |
writeInt64(long v)
Writes the given long (signed 64-bit integer) to the underlying output stream in
little-endian order.
|
void |
writeSerializableFixed(java.util.List<? extends NeoSerializable> v) |
void |
writeSerializableFixed(NeoSerializable v) |
void |
writeSerializableVariable(java.util.List<? extends NeoSerializable> v) |
void |
writeSerializableVariableBytes(java.util.List<? extends NeoSerializable> v) |
void |
writeSerializableVariableBytes(NeoSerializable v) |
void |
writeUInt16(int v)
Writes the first (least-significant) 16 bits of the given int (signed 32-bit integer) to the
underlying output stream in little-endian order.
|
void |
writeUInt32(long v)
Writes the first (least-significant) 32 bits of the given long (signed 64-bit integer) to the
underlying output stream in little-endian order.
|
void |
writeVarBytes(byte[] v) |
void |
writeVarInt(long v) |
public void close()
throws java.io.IOException
close in interface java.lang.AutoCloseablejava.io.IOExceptionpublic void flush()
throws java.io.IOException
java.io.IOExceptionpublic void write(byte[] buffer)
throws java.io.IOException
java.io.IOExceptionpublic void write(byte[] buffer,
int index,
int length)
throws java.io.IOException
java.io.IOExceptionpublic void writeBoolean(boolean v)
throws java.io.IOException
java.io.IOExceptionpublic void writeByte(byte v)
throws java.io.IOException
java.io.IOExceptionpublic void writeDouble(double v)
throws java.io.IOException
java.io.IOExceptionpublic void writeECPoint(org.bouncycastle.math.ec.ECPoint v)
throws java.io.IOException
java.io.IOExceptionpublic void writeFixedString(java.lang.String v,
int length)
throws java.io.IOException
java.io.IOExceptionpublic void writeFloat(float v)
throws java.io.IOException
java.io.IOExceptionpublic void writeInt32(int v)
throws java.io.IOException
java.io.IOExceptionpublic void writeInt64(long v)
throws java.io.IOException
v - the valuejava.io.IOException - if an I/O exception occurs.public void writeUInt32(long v)
throws java.io.IOException
v - the value which needs to be in the range [0, 2^32).java.io.IOException - if an I/O exception occurs.java.lang.IllegalArgumentException - if the arguments value does not lie in the interval [0,
2^32).public void writeSerializableVariableBytes(NeoSerializable v) throws java.io.IOException
java.io.IOExceptionpublic void writeSerializableVariable(java.util.List<? extends NeoSerializable> v) throws java.io.IOException
java.io.IOExceptionpublic void writeSerializableVariableBytes(java.util.List<? extends NeoSerializable> v) throws java.io.IOException
java.io.IOExceptionpublic void writeSerializableFixed(NeoSerializable v) throws java.io.IOException
java.io.IOExceptionpublic void writeSerializableFixed(java.util.List<? extends NeoSerializable> v) throws java.io.IOException
java.io.IOExceptionpublic void writeUInt16(int v)
throws java.io.IOException
v - the value which needs to be in the range [0, 2^16).java.io.IOException - if an I/O exception occurs.java.lang.IllegalArgumentException - if the arguments value does not lie in the interval [0,
2^16).public void writeVarBytes(byte[] v)
throws java.io.IOException
java.io.IOExceptionpublic void writeVarInt(long v)
throws java.io.IOException
java.io.IOException