public class TypeWriter extends Object
Class for writing little-endian data and more.
Constructor and Description |
---|
TypeWriter() |
Modifier and Type | Method and Description |
---|---|
static int |
writeToStream(OutputStream out,
ClassID n)
Writes a 16-byte
ClassID to an output stream. |
static int |
writeToStream(OutputStream out,
double n)
Writes a double value value to an output stream.
|
static int |
writeToStream(OutputStream out,
int n)
Writes a four-byte value to an output stream.
|
static int |
writeToStream(OutputStream out,
long n)
Writes a eight-byte value to an output stream.
|
static void |
writeToStream(OutputStream out,
Property[] properties,
int codepage)
Writes an array of
Property instances to an output stream
according to the Horrible Property Stream Format. |
static int |
writeToStream(OutputStream out,
short n)
Writes a two-byte value (short) to an output stream.
|
static int |
writeUIntToStream(OutputStream out,
long n)
Writes an unsigned four-byte value to an output stream.
|
static void |
writeUShortToStream(OutputStream out,
int n)
Writes an unsigned two-byte value to an output stream.
|
public static int writeToStream(OutputStream out, short n) throws IOException
Writes a two-byte value (short) to an output stream.
out
- The stream to write to.n
- The value to write.IOException
- if an I/O error occurspublic static int writeToStream(OutputStream out, int n) throws IOException
Writes a four-byte value to an output stream.
out
- The stream to write to.n
- The value to write.IOException
- if an I/O error occurspublic static int writeToStream(OutputStream out, long n) throws IOException
Writes a eight-byte value to an output stream.
out
- The stream to write to.n
- The value to write.IOException
- if an I/O error occurspublic static void writeUShortToStream(OutputStream out, int n) throws IOException
Writes an unsigned two-byte value to an output stream.
out
- The stream to write ton
- The value to writeIOException
- if an I/O error occurspublic static int writeUIntToStream(OutputStream out, long n) throws IOException
Writes an unsigned four-byte value to an output stream.
out
- The stream to write to.n
- The value to write.IOException
- if an I/O error occurspublic static int writeToStream(OutputStream out, ClassID n) throws IOException
Writes a 16-byte ClassID
to an output stream.
out
- The stream to write ton
- The value to writeIOException
- if an I/O error occurspublic static void writeToStream(OutputStream out, Property[] properties, int codepage) throws IOException, UnsupportedVariantTypeException
Writes an array of Property
instances to an output stream
according to the Horrible Property Stream Format.
out
- The stream to write toproperties
- The array to write to the streamcodepage
- The codepage number to use for writing stringsIOException
- if an I/O error occursUnsupportedVariantTypeException
- if HPSF does not support some
variant type.public static int writeToStream(OutputStream out, double n) throws IOException
Writes a double value value to an output stream.
out
- The stream to write to.n
- The value to write.IOException
- if an I/O error occursCopyright © 2020. All rights reserved.