public class DataFileReader extends ByteStream
Class for buffered reading of data files (binary format).
empty
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the file.
|
static DataFileReader |
open(java.lang.String file)
Open a data file for read access.
|
int |
readByte()
Read a byte, returning its unsigned value.
|
static byte[] |
readFile(java.lang.String file)
Read the entire contents of
file . |
DataFileReader |
withBufferSize(int size)
Alter the buffer size.
|
asText, copyTo, copyTo, copyToFile, fileWriter, fromBinary, fromBinary, fromBinary, fromFile, fromInput, fromText, getCanUndo, getDataType, readAndClose, readBinary, readBinary, toBuffer, toInput, toString, undoRead, withUndo, writeBinary, writeByte
flush, getEntityTag, getFileName, getMediaType, setEntityTag, setFileName, setMediaType
cloneMutable, equals, getTypeCode, hashCode
public void close()
Close the file.
close
in class StreamBase
public static DataFileReader open(java.lang.String file)
Open a data file for read access.
file
- File name.public int readByte()
Read a byte, returning its unsigned value.
readByte
in class ByteStream
public static byte[] readFile(java.lang.String file)
Read the entire contents of file
.
file
- File name.file
.public DataFileReader withBufferSize(int size)
Alter the buffer size. Should be called after open
, but before reading content.
size
- Buffer size.