Class Infile


public class Infile extends ImageFile

Infile Bridge.

Link to GitHub: Source File.

Author:
Simula Standard, S-Port: The Environment Interface, Øystein Myhre Andersen
  • Field Details

    • lineReader

      private BufferedReader lineReader
      The BufferedReader used.
    • rest

      private String rest
      Utility variable
    • sysinRest

      private static String sysinRest
      Utility variable
  • Constructor Details

    • Infile

      public Infile(String fileName, int type, String action, int imglng)
      Construct a new Infile with the given arguments.
      Parameters:
      fileName - the fileName
      type - the fileType
      action - the action string
      imglng - the image length
  • Method Details

    • clfile

      public void clfile()
      Description copied from class: Dataset
      Close the underlying file
      Overrides:
      clfile in class Dataset
    • inimage

      public int inimage(ObjectAddress chrAddr, int nchr)

      Procedure inimage.

      Reads a line from the underlying file into a character area

      A record is read from the current position of the data set into the image. If the number of characters in the record exceeds the image length, the action taken is system dependent:

      • If the system permits partial record read, image.length characters are read, filled := image.length, and status 34 is returned. In this case the next inimage (on this data set) should continue reading from the next position in the partially read record.

      • If partial record reading is not possible, status error 12 is set and filled is set to zero; the remainder of the record is in this case skipped.

      Except for the case of partial record reading the data set will be positioned at the sequentially next record.

      Inimage is legal on infiles and directfiles only.

      This routine may change the value of the global variable status to one of the values given in app. C. If the status returned is non-zero, filled must be zero, except for the partial read case discussed above (status 12).

      Overrides:
      inimage in class ImageFile
      Parameters:
      chrAddr - the start of the area
      nchr - the length of the area
      Returns:
      the number of characters filled
    • readLine

      private static String readLine() throws IOException, TimeoutException
      Utility: read a line
      Returns:
      the line string read
      Throws:
      IOException - if IOException occur
      TimeoutException - if Timeout occur
    • IO_read

      private static int IO_read(int timeout, TimeUnit unit) throws IOException, TimeoutException
      Utility: read a character with timeout
      Parameters:
      timeout - the timeout duration
      unit - the TimeUnit
      Returns:
      the line string read
      Throws:
      IOException - if IOException occur
      TimeoutException - if Timeout occur
    • sysinInimage

      public static int sysinInimage(ObjectAddress chrAddr, int nchr)
      Reads a line from the underlying file into a character area
      Parameters:
      chrAddr - the start of the area
      nchr - the length of the area
      Returns:
      the number of characters filled