Class StreamWrapper

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

    public final class StreamWrapper
    extends java.lang.Object
    implements java.io.Closeable
    Wrapper around a length-limited InputStream.
    Author:
    Oliver Jowett (oliver@opencloud.com)
    • Constructor Detail

      • StreamWrapper

        public StreamWrapper​(byte[] data,
                             int offset,
                             int length)
      • StreamWrapper

        public StreamWrapper​(java.io.InputStream stream,
                             int length)
    • Method Detail

      • getStream

        public java.io.InputStream getStream()
                                      throws java.io.IOException
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException
      • getLength

        public int getLength()
      • getOffset

        public int getOffset()
      • getBytes

        public byte[] getBytes()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object