Class ByteBufferOutputStream

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

    public class ByteBufferOutputStream
    extends java.io.OutputStream
    Wrap an existing ByteBuffer as OutputStream.
    Since:
    0.4.0
    Author:
    Erich Schubert
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) java.nio.ByteBuffer buffer
      The actual buffer we're using.
    • Constructor Summary

      Constructors 
      Constructor Description
      ByteBufferOutputStream​(java.nio.ByteBuffer buffer)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void write​(byte[] b, int off, int len)  
      void write​(int b)  
      • Methods inherited from class java.io.OutputStream

        close, flush, nullOutputStream, write
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • buffer

        final java.nio.ByteBuffer buffer
        The actual buffer we're using.
    • Constructor Detail

      • ByteBufferOutputStream

        public ByteBufferOutputStream​(java.nio.ByteBuffer buffer)
        Constructor.
        Parameters:
        buffer - ByteBuffer to wrap.
    • Method Detail

      • write

        public void write​(int b)
        Specified by:
        write in class java.io.OutputStream
      • write

        public void write​(byte[] b,
                          int off,
                          int len)
        Overrides:
        write in class java.io.OutputStream