All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class asjava.uniobjects.UniSequentialFile

java.lang.Object
   |
   +----asjava.uniobjects.UniBase
           |
           +----asjava.uniobjects.UniSequentialFile

public class UniSequentialFile
extends UniBase
UniSequentialFile is created via the UniSession.openSequential method. It is used to define and manage UniVerse Sequential Files, which are operating system files.

Version:
Version 1.0
Author:
David T. Meeks

Variable Index

 o uniFileHandle

Method Index

 o close()
Closes an open sequential file
 o fileSeek(int, int)
Moves the file pointer within the Sequential File by an offset position specified in bytes, relative to the current position, beginning of the file, or the end of the file, as determined by the aRelPos parameter.
 o getReadSize()
returns the current readblock size for this object
 o getTimeout()
returns the current timeout value for this object
 o isOpen()
returns whether or not this sequential file is open
 o open()
physically opens the server-side file, creating it if the CreateFlag value was set and the file doesn't exist
 o readBlk()
reads a block of data from the sequential file.
 o readLine()
reads a line of data from the sequential file.
 o setReadSize(int)
sets the current ReadSize for this object
 o setTimeout(int)
sets the current Timeout for this object
 o writeBlk(Object)
writes the given block to the sequential file, at the location currently set
 o writeEOF()
writes an EOF marker
 o writeLine(Object)
writes the given line to the sequential file, at the location currently set

Variables

 o uniFileHandle
 protected int uniFileHandle

Methods

 o close
 public void close() throws UniSequentialFileException
Closes an open sequential file

Throws: UniSequentialFileException
is thrown if an error occurs
 o fileSeek
 public void fileSeek(int aRelPos,
                      int aOffset) throws UniSequentialFileException
Moves the file pointer within the Sequential File by an offset position specified in bytes, relative to the current position, beginning of the file, or the end of the file, as determined by the aRelPos parameter.

Parameters:
aRelPos - integer denoting the relative position within a file to seek from. A 0 (UniT_START) implies to start from the beginning of the file. 1 (UniT_CURR) means to start from the current position. 2 (UniT_END) means to start from the end of the file.
aOffset - integer denoting the number of bytes before or after aRelPos. A negative value moves the pointer to a position before aRelPos
Throws: UniSequentialFileException
if any errors occur
 o getReadSize
 public int getReadSize()
returns the current readblock size for this object

Returns:
integer value representing the current block size to be used when reading blocks of data
See Also:
setReadSize
 o getTimeout
 public int getTimeout()
returns the current timeout value for this object

Returns:
integer value representing the current timeout value
See Also:
setTimeout
 o isOpen
 public boolean isOpen()
returns whether or not this sequential file is open

Returns:
boolean value denoting whether the file is open. true represents the file being open
 o open
 public void open() throws UniSequentialFileException
physically opens the server-side file, creating it if the CreateFlag value was set and the file doesn't exist

Throws: UniSequentialFileException
is thrown whenever an error occurs
 o readBlk
 public UniString readBlk() throws UniSequentialFileException
reads a block of data from the sequential file. The size of the data block is defined by what is set using the setReadSize method. Upon completion, the getReadSize method can be used to determine the number of bytes read. Additionally, the status method will return one of the following value:

Returns:
a String value representing the data that was read
Throws: UniSequentialFileException
is thrown if an error occurs
 o readLine
 public UniString readLine() throws UniSequentialFileException
reads a line of data from the sequential file. The lines must be delimited with a newline character. Additionally, the status method will return one of the following values:

Returns:
a String value representing the data that was read
Throws: UniSequentialFileException
is thrown if an error occurs
 o setReadSize
 public void setReadSize(int aBlockSize)
sets the current ReadSize for this object

Parameters:
aBlockSize - the block size to be set for subsequent read requests
See Also:
getReadSize
 o setTimeout
 public void setTimeout(int aTimeOut) throws UniSequentialFileException
sets the current Timeout for this object

Parameters:
aTimeout - the timeout value to be used for read requests
Throws: UniSequentialFileException
is thrown if there is an error
See Also:
setTimeout
 o writeBlk
 public void writeBlk(Object aString) throws UniSequentialFileException
writes the given block to the sequential file, at the location currently set

Parameters:
aString - a String representing the data block to be written
Throws: UniSequentialFileException
is thrown if an error occurs
 o writeEOF
 public void writeEOF() throws UniSequentialFileException
writes an EOF marker

Parameters:
aString - a String representing the data block to be written
Throws: UniSequentialFileException
is thrown if an error occurs
 o writeLine
 public void writeLine(Object aString) throws UniSequentialFileException
writes the given line to the sequential file, at the location currently set

Parameters:
aString - a String representing the line to be written
Throws: UniSequentialFileException
is thrown if an error occurs

All Packages  Class Hierarchy  This Package  Previous  Next  Index