Package binaryFileStorage
Class BinaryInputStream
java.lang.Object
binaryFileStorage.BinaryInputStream
Used to read data back from a binary data file and either send
it off to the associated PamDataBlock or hand it back to the
BinaryStore controller, e.g. for writing into a new file if
data are being updated.
- Author:
- Doug Gillespie.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
finalize()
long
int
protected boolean
Open an input file for reading.protected BinaryHeader
Reads the binary header from the file.protected BinaryObjectData
readNextObject
(int fileFormat) Read the next object from the file.
-
Constructor Details
-
Method Details
-
finalize
-
openFile
Open an input file for reading.- Parameters:
inputFile
- file to open.- Returns:
- true is successful.
-
closeFile
protected void closeFile() -
readHeader
Reads the binary header from the file.- Returns:
- a binary header or null if the header could not be read
-
readNextObject
Read the next object from the file.The object data will be packed up in a BinaryObjectData which will have various fields filled in depending on the type of object.
null will be returned when there is an eof or when the file footer has been identified.
The calling function can check the file was complete by testing whether or not the file footer is null.
- Parameters:
fileFormat
- Over-arching File format read from the file header for files and incorporated into additional header structures for network and other data.- Returns:
- data object.
-
getUnitsRead
public int getUnitsRead()- Returns:
- the unitsRead
-
getLastObjectTime
public long getLastObjectTime()- Returns:
- the lastObjectTime
-
getPamDataBlock
- Returns:
- the pamDataBlock
-
getCurrentFile
- Returns:
- the currentFile
-