Package si.inova.neatle.source
Class ByteArrayInputSource
- java.lang.Object
-
- si.inova.neatle.source.ByteArrayInputSource
-
- All Implemented Interfaces:
InputSource
- Direct Known Subclasses:
StringInputSource
public class ByteArrayInputSource extends java.lang.Object implements InputSource
An input source that provides a byte array.
-
-
Constructor Summary
Constructors Constructor Description ByteArrayInputSource(byte[] data)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes the stream source.byte[]
nextChunk()
Reads next "chunk" from this stream.void
open()
Opens the stream source.
-
-
-
Method Detail
-
close
public void close() throws java.io.IOException
Description copied from interface:InputSource
Closes the stream source.- Specified by:
close
in interfaceInputSource
- Throws:
java.io.IOException
- if an IO error occurs
-
open
public void open() throws java.io.IOException
Description copied from interface:InputSource
Opens the stream source.- Specified by:
open
in interfaceInputSource
- Throws:
java.io.IOException
- if an IO error occurs
-
nextChunk
public byte[] nextChunk() throws java.io.IOException
Description copied from interface:InputSource
Reads next "chunk" from this stream.- Specified by:
nextChunk
in interfaceInputSource
- Returns:
- the number of bytes read or null if there is nothing more to read.
- Throws:
java.io.IOException
- if an IO error occurs
-
-