Package com.globalmentor.io
Class OutputStreams
java.lang.Object
com.globalmentor.io.OutputStreams
Class to manipulate output streams.
- Author:
- Garret Wilson
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
write
(OutputStream outputStream, int b, int count) Writes the given byte to the output stream the specified number of times.static void
writeLowOrderFirst
(OutputStream outputStream, long value, int byteCount) Writes the given number of bytes of the given value, low-ordered bytes first.
-
Constructor Details
-
OutputStreams
public OutputStreams()
-
-
Method Details
-
write
Writes the given byte to the output stream the specified number of times.- Parameters:
outputStream
- The stream the bytes should be written to.b
- The byte to write; the 24 high-order bits are ignored.count
- The number of bytes to write.- Throws:
IOException
- Thrown if there is an error writing to the output stream.
-
writeLowOrderFirst
public static void writeLowOrderFirst(OutputStream outputStream, long value, int byteCount) throws IllegalArgumentException, IOException Writes the given number of bytes of the given value, low-ordered bytes first.- Parameters:
outputStream
- The stream the bytes should be written to.value
- The value to write.byteCount
- The number of bytes to write (<=4).- Throws:
IllegalArgumentException
- Thrown if the byte count is over four.IOException
- Thrown if there is an error writing to the output stream.
-