public class ByteWriter extends Object
| Constructor and Description |
|---|
ByteWriter()
Constructor
|
ByteWriter(ByteOrder byteOrder)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the byte writer
|
ByteOrder |
getByteOrder()
Get the byte order
|
byte[] |
getBytes()
Get the written bytes
|
ByteArrayOutputStream |
getOutputStream()
Get the byte array 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 |
writeBytes(byte[] value)
Write the bytes
|
void |
writeDouble(double value)
Write a double
|
void |
writeFloat(float value)
Write a float
|
void |
writeInt(int value)
Write an integer
|
void |
writeShort(short value)
Write a short
|
int |
writeString(String value)
Write a String
|
void |
writeUnsignedByte(short value)
Write an unsigned byte
|
void |
writeUnsignedInt(long value)
Write an unsigned int
|
void |
writeUnsignedShort(int value)
Write an unsigned short
|
public ByteWriter()
public ByteWriter(ByteOrder byteOrder)
byteOrder - byte orderpublic void close()
public ByteArrayOutputStream getOutputStream()
public ByteOrder getByteOrder()
public void setByteOrder(ByteOrder byteOrder)
byteOrder - byte orderpublic byte[] getBytes()
public int size()
public int writeString(String value) throws IOException
value - string valueIOExceptionpublic void writeByte(byte value)
value - bytepublic void writeUnsignedByte(short value)
value - unsigned byte as a shortpublic void writeBytes(byte[] value)
throws IOException
value - bytesIOExceptionpublic void writeShort(short value)
throws IOException
value - shortIOExceptionpublic void writeUnsignedShort(int value)
throws IOException
value - unsigned short as an intIOExceptionpublic void writeInt(int value)
throws IOException
value - intIOExceptionpublic void writeUnsignedInt(long value)
throws IOException
value - unsigned int as longIOExceptionpublic void writeFloat(float value)
throws IOException
value - floatIOExceptionpublic void writeDouble(double value)
throws IOException
value - doubleIOExceptionCopyright © 2017 National Geospatial-Intelligence Agency. All rights reserved.