public class ByteWriter extends Object
| Modifier and Type | Field and Description |
|---|---|
static ByteOrder |
DEFAULT_BYTE_ORDER
Default write byte order
|
| Constructor and Description |
|---|
ByteWriter()
Constructor
|
ByteWriter(ByteOrder byteOrder)
Constructor
|
ByteWriter(OutputStream outputStream)
Constructor
|
ByteWriter(OutputStream outputStream,
ByteOrder byteOrder)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the byte writer
|
ByteArrayOutputStream |
getByteArrayOutputStream()
Get the output stream
|
ByteOrder |
getByteOrder()
Get the byte order
|
byte[] |
getBytes()
Get the written bytes
|
OutputStream |
getOutputStream()
Get the output stream
|
void |
setByteOrder(ByteOrder byteOrder)
Set the byte order
|
int |
size()
Get the current size in bytes written
|
void |
writeByte(byte value)
Write a byte
|
void |
writeDouble(double value)
Write a double
|
void |
writeInt(int value)
Write an integer
|
void |
writeString(String value)
Write a String
|
public static final ByteOrder DEFAULT_BYTE_ORDER
public ByteWriter()
public ByteWriter(OutputStream outputStream)
outputStream - output streampublic ByteWriter(ByteOrder byteOrder)
byteOrder - byte orderpublic ByteWriter(OutputStream outputStream, ByteOrder byteOrder)
outputStream - output streambyteOrder - byte orderpublic OutputStream getOutputStream()
public ByteArrayOutputStream getByteArrayOutputStream()
public void close()
public ByteOrder getByteOrder()
public void setByteOrder(ByteOrder byteOrder)
byteOrder - byte orderpublic byte[] getBytes()
public int size()
public void writeString(String value) throws IOException
value - string valueIOException - upon errorpublic void writeByte(byte value)
throws IOException
value - byteIOException - upon errorpublic void writeInt(int value)
throws IOException
value - int valueIOException - upon errorpublic void writeDouble(double value)
throws IOException
value - doubleIOException - upon errorCopyright © 2021 National Geospatial-Intelligence Agency. All rights reserved.