Package com.attivio.util.stream
Class ByteArrayInputStreamBuilder
- java.lang.Object
-
- com.attivio.util.stream.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 voidclose()no opjava.io.InputStreamcreateInputStream()Return a stream in a state where no bytes have been read from it yet.java.io.ByteArrayInputStreamlastStream()
-
-
-
Method Detail
-
createInputStream
public java.io.InputStream createInputStream() throws java.io.IOExceptionReturn 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:
createInputStreamin interfaceInputStreamBuilder- Throws:
java.io.IOException
-
lastStream
public java.io.ByteArrayInputStream lastStream()
-
close
public void close() throws java.io.IOExceptionno op- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfaceInputStreamBuilder- Throws:
java.io.IOException
-
-