Class OutputStreamByteOutput

java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
org.jboss.marshalling.OutputStreamByteOutput
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable, ByteOutput

public class OutputStreamByteOutput extends FilterOutputStream implements ByteOutput
An OutputStream which implements ByteInput and reads data from another OutputStream. Usually the Marshalling.createByteOutput(java.nio.ByteBuffer) method should be used to create instances because it can detect when the target already extends OutputStream.
  • Constructor Details

    • OutputStreamByteOutput

      public OutputStreamByteOutput(OutputStream outputStream)
      Construct a new instance.
      Parameters:
      outputStream - the output stream to write to
  • Method Details

    • write

      public void write(byte[] b, int off, int len) throws IOException
      Writes len bytes from the specified byte array starting at offset off to this output stream.
      Specified by:
      write in interface ByteOutput
      Overrides:
      write in class FilterOutputStream
      Parameters:
      b - the data
      off - the start offset in the data
      len - the number of bytes to write
      Throws:
      IOException - if an I/O error occurs