Class BinaryInputStream

java.lang.Object
binaryFileStorage.BinaryInputStream

public class BinaryInputStream extends Object
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 Details Link icon

  • Method Details Link icon

    • finalize Link icon

      protected void finalize() throws Throwable
      Overrides:
      finalize in class Object
      Throws:
      Throwable
    • openFile Link icon

      protected boolean openFile(File inputFile)
      Open an input file for reading.
      Parameters:
      inputFile - file to open.
      Returns:
      true is successful.
    • closeFile Link icon

      protected void closeFile()
    • readHeader Link icon

      protected BinaryHeader readHeader()
      Reads the binary header from the file.
      Returns:
      a binary header or null if the header could not be read
    • readNextObject Link icon

      protected BinaryObjectData readNextObject(int fileFormat)
      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.
    • getBinaryFooter Link icon

      public BinaryFooter getBinaryFooter()
      Returns:
      the binaryFooter
    • getUnitsRead Link icon

      public int getUnitsRead()
      Returns:
      the unitsRead
    • getLastObjectTime Link icon

      public long getLastObjectTime()
      Returns:
      the lastObjectTime
    • getPamDataBlock Link icon

      public PamDataBlock getPamDataBlock()
      Returns:
      the pamDataBlock
    • getCurrentFile Link icon

      public File getCurrentFile()
      Returns:
      the currentFile