Package loci.poi.hpsf
Class TypeWriter
java.lang.Object
loci.poi.hpsf.TypeWriter
Class for writing little-endian data and more.
- Since:
- 2003-02-20
- Version:
- $Id: TypeWriter.java 489730 2006-12-22 19:18:16Z bayard $
- Author:
- Rainer Klute <klute@rainer-klute.de>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intwriteToStream(OutputStream out, double n) Writes a double value value to an output stream.static intwriteToStream(OutputStream out, int n) Writes a four-byte value to an output stream.static intwriteToStream(OutputStream out, long n) Writes a eight-byte value to an output stream.static intwriteToStream(OutputStream out, short n) Writes a two-byte value (short) to an output stream.static intwriteToStream(OutputStream out, ClassID n) Writes a 16-byteClassIDto an output stream.static voidwriteToStream(OutputStream out, Property[] properties, int codepage) Writes an array ofPropertyinstances to an output stream according to the Horrible Property Stream Format.static intwriteUIntToStream(OutputStream out, long n) Writes an unsigned four-byte value to an output stream.static voidwriteUShortToStream(OutputStream out, int n) Writes an unsigned two-byte value to an output stream.
-
Constructor Details
-
TypeWriter
public TypeWriter()
-
-
Method Details
-
writeToStream
Writes a two-byte value (short) to an output stream.
- Parameters:
out- The stream to write to.n- The value to write.- Returns:
- The number of bytes that have been written.
- Throws:
IOException- if an I/O error occurs
-
writeToStream
Writes a four-byte value to an output stream.
- Parameters:
out- The stream to write to.n- The value to write.- Returns:
- The number of bytes written to the output stream.
- Throws:
IOException- if an I/O error occurs
-
writeToStream
Writes a eight-byte value to an output stream.
- Parameters:
out- The stream to write to.n- The value to write.- Returns:
- The number of bytes written to the output stream.
- Throws:
IOException- if an I/O error occurs
-
writeUShortToStream
Writes an unsigned two-byte value to an output stream.
- Parameters:
out- The stream to write ton- The value to write- Throws:
IOException- if an I/O error occurs
-
writeUIntToStream
Writes an unsigned four-byte value to an output stream.
- Parameters:
out- The stream to write to.n- The value to write.- Returns:
- The number of bytes that have been written to the output stream.
- Throws:
IOException- if an I/O error occurs
-
writeToStream
Writes a 16-byte
ClassIDto an output stream.- Parameters:
out- The stream to write ton- The value to write- Returns:
- The number of bytes written
- Throws:
IOException- if an I/O error occurs
-
writeToStream
public static void writeToStream(OutputStream out, Property[] properties, int codepage) throws IOException, UnsupportedVariantTypeException Writes an array of
Propertyinstances to an output stream according to the Horrible Property Stream Format.- Parameters:
out- The stream to write toproperties- The array to write to the streamcodepage- The codepage number to use for writing strings- Throws:
IOException- if an I/O error occursUnsupportedVariantTypeException- if HPSF does not support some variant type.
-
writeToStream
Writes a double value value to an output stream.
- Parameters:
out- The stream to write to.n- The value to write.- Returns:
- The number of bytes written to the output stream.
- Throws:
IOException- if an I/O error occurs
-