jasp.io
Class TextStream

java.lang.Object
  |
  +--jasp.io.TextStream

public class TextStream
extends java.lang.Object

Allows you to read and write text files


Constructor Summary
TextStream(java.lang.String name)
           
TextStream(java.lang.String name, int iomode)
           
TextStream(java.lang.String name, int iomode, boolean unicode)
           
 
Method Summary
 void Close()
          Close an open TextStream file.
 boolean getAtEndOfLine()
          Read-only property that returns True if the file pointer immediately precedes the end-of-line marker in a TextStream file; False if it is not.
 boolean getAtEndOfStream()
          Read-only property that returns True if the file pointer is at the end of a TextStream file; False if it is not.
 int getColumn()
          Read-only property that returns the column number of the current character position in a TextStream file.
 int getLine()
          Read-only property that returns the current line number in a TextStream file.
 java.lang.String Read(int characters)
          Reads a specified number of characters from a TextStream file and returns the resulting string.
 java.lang.String ReadAll()
          Reads an entire TextStream file and returns the resulting string.
 java.lang.String ReadLine()
          Reads an entire line(up to,but not including,the newline character)from a TextStream file and returns the result- ing string.
 void Skip(int characters)
          Skips a specified number of characters when reading a TextStream file.
 void SkipLine()
          Skips the next line when reading a TextStream file.
 void Write(java.lang.String str)
          Writes a string to a TextStream file.
 void WriteBlankLines(int lines)
          Writes a specified number of newline characters to a TextStream file.
 void WriteLine()
          Writes a specified string and newline character to a TextStream file.
 void WriteLine(java.lang.String string)
          Writes a specified string and newline character to a TextStream file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextStream

public TextStream(java.lang.String name)

TextStream

public TextStream(java.lang.String name,
                  int iomode)

TextStream

public TextStream(java.lang.String name,
                  int iomode,
                  boolean unicode)
Method Detail

getAtEndOfLine

public boolean getAtEndOfLine()
Read-only property that returns True if the file pointer immediately precedes the end-of-line marker in a TextStream file; False if it is not.

getAtEndOfStream

public boolean getAtEndOfStream()
                         throws java.lang.Exception
Read-only property that returns True if the file pointer is at the end of a TextStream file; False if it is not.

getColumn

public int getColumn()
Read-only property that returns the column number of the current character position in a TextStream file.

getLine

public int getLine()
Read-only property that returns the current line number in a TextStream file.

Close

public void Close()
           throws java.lang.Exception
Close an open TextStream file.

Read

public java.lang.String Read(int characters)
                      throws java.lang.Exception
Reads a specified number of characters from a TextStream file and returns the resulting string.
Parameters:
characters - Number of characters you want to read from the file.

ReadAll

public java.lang.String ReadAll()
                         throws java.lang.Exception
Reads an entire TextStream file and returns the resulting string.

ReadLine

public java.lang.String ReadLine()
                          throws java.lang.Exception
Reads an entire line(up to,but not including,the newline character)from a TextStream file and returns the result- ing string.

Skip

public void Skip(int characters)
          throws java.lang.Exception
Skips a specified number of characters when reading a TextStream file.
Parameters:
characters - Number of characters to skip when reading a file.

SkipLine

public void SkipLine()
              throws java.lang.Exception
Skips the next line when reading a TextStream file.

Write

public void Write(java.lang.String str)
           throws java.lang.Exception
Writes a string to a TextStream file.

WriteBlankLines

public void WriteBlankLines(int lines)
                     throws java.lang.Exception
Writes a specified number of newline characters to a TextStream file.
Parameters:
lines - Number of newline characters you want to write to the file.

WriteLine

public void WriteLine()
               throws java.lang.Exception
Writes a specified string and newline character to a TextStream file.

WriteLine

public void WriteLine(java.lang.String string)
               throws java.lang.Exception
Writes a specified string and newline character to a TextStream file.
Parameters:
string - The text you want to write to the file. If omitted, a newline character is written to the file.