Class ByteArrayInputStreamBuilder

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

    public class ByteArrayInputStreamBuilder
    extends java.lang.Object
    implements InputStreamBuilder
    Creates InputStreams from the supplied byte array.
    • Constructor Summary

      Constructors 
      Constructor Description
      ByteArrayInputStreamBuilder​(byte[] b)
      Stores the internal byte array without copying.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      no op
      java.io.InputStream createInputStream()
      Return a stream in a state where no bytes have been read from it yet.
      java.io.ByteArrayInputStream lastStream()  
      • Methods inherited from class java.lang.Object

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

      • ByteArrayInputStreamBuilder

        public ByteArrayInputStreamBuilder​(byte[] b)
        Stores the internal byte array without copying.
    • Method Detail

      • createInputStream

        public java.io.InputStream createInputStream()
                                              throws java.io.IOException
        Return a stream in a state where no bytes have been read from it yet. For example a newly created stream meets these criteria. The caller should handle closing the stream.
        Specified by:
        createInputStream in interface InputStreamBuilder
        Throws:
        java.io.IOException
      • lastStream

        public java.io.ByteArrayInputStream lastStream()
      • close

        public void close()
                   throws java.io.IOException
        no op
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface InputStreamBuilder
        Throws:
        java.io.IOException