Class ByteBufferInputStream

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

    public class ByteBufferInputStream
    extends java.io.InputStream
    Wrap an existing ByteBuffer as InputStream.
    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
      ByteBufferInputStream​(java.nio.ByteBuffer buffer)
      Constructor.
    • Method Summary

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

        available, close, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
      • 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

      • ByteBufferInputStream

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

      • read

        public int read()
        Specified by:
        read in class java.io.InputStream
      • read

        public int read​(byte[] b,
                        int off,
                        int len)
        Overrides:
        read in class java.io.InputStream