public class Source extends Object implements Disposable
Must be disposed to ensure that the readers are closed and the file free for other uses. Does not need to be disposed if a byte array is used.
| Modifier and Type | Field and Description |
|---|---|
private byte[] |
data |
private FileInputStream |
fileInputStream |
| Constructor and Description |
|---|
Source(byte[] data) |
Source(String filename) |
| Modifier and Type | Method and Description |
|---|---|
private ByteBuffer |
createByteBuffer() |
private MappedByteBuffer |
createMappedByteBuffer() |
BinaryReader |
createReader()
Creates a new reader and stores a reference to it.
|
void |
dispose() |
private final FileInputStream fileInputStream
private final byte[] data
public Source(String filename) throws FileNotFoundException
FileNotFoundExceptionpublic Source(byte[] data)
public void dispose()
dispose in interface Disposablepublic BinaryReader createReader() throws IOException
IOExceptionprivate ByteBuffer createByteBuffer() throws IOException
IOExceptionprivate MappedByteBuffer createMappedByteBuffer() throws IOException
IOException