Class OutputStreamByteOutput

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable, ByteOutput

    public class OutputStreamByteOutput
    extends java.io.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.
    • Field Summary

      • Fields inherited from class java.io.FilterOutputStream

        out
    • Constructor Summary

      Constructors 
      Constructor Description
      OutputStreamByteOutput​(java.io.OutputStream outputStream)
      Construct a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void write​(byte[] b, int off, int len)
      Writes len bytes from the specified byte array starting at offset off to this output stream.
      • Methods inherited from class java.io.FilterOutputStream

        close, flush, write, write
      • Methods inherited from class java.io.OutputStream

        nullOutputStream
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.io.Closeable

        close
      • Methods inherited from interface java.io.Flushable

        flush
    • Constructor Detail

      • OutputStreamByteOutput

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

      • write

        public void write​(byte[] b,
                          int off,
                          int len)
                   throws java.io.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 java.io.FilterOutputStream
        Parameters:
        b - the data
        off - the start offset in the data
        len - the number of bytes to write
        Throws:
        java.io.IOException - if an I/O error occurs