|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectasjava.uniobjects.UniBase
asjava.uniobjects.UniSequentialFile
UniSequentialFile
is created via the UniSession.openSequential
method. It is used to define and manage UniVerse Sequential Files, which are operating system
files.
Field Summary | |
---|---|
protected int |
uniFileHandle
|
Fields inherited from class asjava.uniobjects.UniBase |
---|
inPacket, outPacket, uniConnection, uniEncryptionType, uniParentSession, uniStatus |
Method Summary | |
---|---|
void |
close()
Closes an open sequential file |
void |
fileSeek(int aRelPos,
int aOffset)
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. |
int |
getReadSize()
returns the current readblock size for this object |
int |
getTimeout()
returns the current timeout value for this object |
boolean |
isOpen()
returns whether or not this sequential file is open |
void |
open()
physically opens the server-side file, creating it if the CreateFlag value was set and the file doesn't exist |
UniString |
readBlk()
reads a block of data from the sequential file. |
UniString |
readLine()
reads a line of data from the sequential file. |
void |
setReadSize(int aBlockSize)
sets the current ReadSize for this object |
void |
setTimeout(int aTimeOut)
sets the current Timeout for this object |
void |
writeBlk(java.lang.Object aString)
writes the given block to the sequential file, at the location currently set |
void |
writeEOF()
writes an EOF marker |
void |
writeLine(java.lang.Object aString)
writes the given line to the sequential file, at the location currently set |
Methods inherited from class asjava.uniobjects.UniBase |
---|
getEncryptionType, isCommandActive, setEncryptionType, status |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected int uniFileHandle
Method Detail |
public void close() throws UniSequentialFileException
UniSequentialFileException
- is thrown if an error occurspublic void fileSeek(int aRelPos, int aOffset) throws UniSequentialFileException
aRelPos
parameter.
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
UniSequentialFileException
- if any errors occurpublic int getReadSize()
setReadSize(int)
public int getTimeout()
setTimeout(int)
public boolean isOpen()
true
represents the file being openpublic void open() throws UniSequentialFileException
UniSequentialFileException
- is thrown whenever an error occurspublic UniString readBlk() throws UniSequentialFileException
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:
UniSequentialFileException
- is thrown if an error occurspublic UniString readLine() throws UniSequentialFileException
status
method will return one of the following values:
getReadSize
method is 0 or less
UniSequentialFileException
- is thrown if an error occurspublic void setReadSize(int aBlockSize)
aBlockSize
- the block size to be set for subsequent read requestsgetReadSize()
public void setTimeout(int aTimeOut) throws UniSequentialFileException
aTimeOut
- the timeout value to be used for read requests
UniSequentialFileException
- is thrown if there is an errorsetTimeout(int)
public void writeBlk(java.lang.Object aString) throws UniSequentialFileException
aString
- a String representing the data block to be written
UniSequentialFileException
- is thrown if an error occurspublic void writeEOF() throws UniSequentialFileException
UniSequentialFileException
- is thrown if an error occurspublic void writeLine(java.lang.Object aString) throws UniSequentialFileException
aString
- a String representing the line to be written
UniSequentialFileException
- is thrown if an error occurs
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |