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 void
close()
no opjava.io.InputStream
createInputStream()
Return a stream in a state where no bytes have been read from it yet.java.io.ByteArrayInputStream
lastStream()
-
-
-
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 interfaceInputStreamBuilder
- Throws:
java.io.IOException
-
lastStream
public java.io.ByteArrayInputStream lastStream()
-
close
public void close() throws java.io.IOException
no op- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Specified by:
close
in interfaceInputStreamBuilder
- Throws:
java.io.IOException
-
-