Class OutputStreams

java.lang.Object
com.globalmentor.io.OutputStreams

public class OutputStreams extends Object
Class to manipulate output streams.
Author:
Garret Wilson
  • Constructor Details

    • OutputStreams

      public OutputStreams()
  • Method Details

    • write

      public static void write(OutputStream outputStream, int b, int count) throws IOException
      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.