|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.InputStream
com.ibm.as400.access.IFSFileInputStream
com.ibm.as400.access.IFSTextFileInputStream
public class IFSTextFileInputStream
Represents an integrated file system input stream for character data.
IFSTextFileInputStream objects are capable of generating file events
which call the following FileListener methods: fileClosed and fileOpened.
Note: This class is provided for situations where an InputStream is required. The preferred method of reading a text file is via IFSFileReader.
The following example illustrates the use of IFSTextFileInputStream:
// Work with /File on the system eniac.
AS400 as400 = new AS400("eniac");
IFSTextFileInputStream file = new IFSTextFileInputStream(as400, "/File");
// Read the first four characters of the file.
String s = file.read(4);
// Display the characters read.
System.out.println(s);
// Close the file.
file.close();
FileEvent,
IFSFileInputStream.addFileListener(com.ibm.as400.access.FileListener),
IFSFileInputStream.removeFileListener(com.ibm.as400.access.FileListener),
Serialized Form| Field Summary |
|---|
| Fields inherited from class com.ibm.as400.access.IFSFileInputStream |
|---|
fd_, SHARE_ALL, SHARE_NONE, SHARE_READERS, SHARE_WRITERS |
| Constructor Summary | |
|---|---|
IFSTextFileInputStream()
Constructs an IFSTextFileInputStream object. |
|
IFSTextFileInputStream(AS400 system,
IFSFile file,
int shareOption)
Constructs an IFSTextFileInputStream object. |
|
IFSTextFileInputStream(AS400 system,
IFSJavaFile file,
int shareOption)
Constructs an IFSTextFileInputStream object. |
|
IFSTextFileInputStream(AS400 system,
String name)
Constructs an IFSTextFileInputStream object. |
|
IFSTextFileInputStream(AS400 system,
String name,
int shareOption)
Constructs an IFSTextFileInputStream object. |
|
IFSTextFileInputStream(IFSFile file)
Constructs an IFSTextFileInputStream object. |
|
IFSTextFileInputStream(IFSFileDescriptor fd)
Constructs an IFSTextFileInputStream object. |
|
IFSTextFileInputStream(IFSJavaFile file)
Constructs an IFSTextFileInputStream object. |
|
| Method Summary | |
|---|---|
String |
read(int length)
Reads up to length characters from this text file input stream. |
| Methods inherited from class com.ibm.as400.access.IFSFileInputStream |
|---|
addFileListener, addPropertyChangeListener, addVetoableChangeListener, available, close, finalize, getFD, getPath, getShareOption, getSystem, lock, lock, open, read, read, read, removeFileListener, removePropertyChangeListener, removeVetoableChangeListener, reset, rewind, setFD, setPath, setShareOption, setSystem, skip, unlock |
| Methods inherited from class java.io.InputStream |
|---|
mark, markSupported |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IFSTextFileInputStream()
public IFSTextFileInputStream(AS400 system,
String name)
throws AS400SecurityException,
IOException
system - The AS400 that contains the file.name - The integrated file system name.
AS400SecurityException - If a security or authority error occurs.
IOException - If an error occurs while communicating with the system.
public IFSTextFileInputStream(AS400 system,
String name,
int shareOption)
throws AS400SecurityException,
IOException
system - The AS400 that contains the file.name - The integrated file system name.shareOption - Indicates how users can access the file. AS400SecurityException - If a security or authority error occurs.
IOException - If an error occurs while communicating with the system.
public IFSTextFileInputStream(IFSFile file)
throws AS400SecurityException,
IOException
file - The file to be opened for reading.
AS400SecurityException - If a security or authority error occurs.
IOException - If an error occurs while communicating with the system.
public IFSTextFileInputStream(AS400 system,
IFSFile file,
int shareOption)
throws AS400SecurityException,
IOException
system - The AS400 that contains the file.file - The file to be opened for reading.shareOption - Indicates how users can access the file. AS400SecurityException - If a security or authority error occurs.
IOException - If an error occurs while communicating with the system.
public IFSTextFileInputStream(IFSJavaFile file)
throws AS400SecurityException,
IOException
file - The file to be opened for reading.
AS400SecurityException - If a security or authority error occurs.
IOException - If an error occurs while communicating with the system.
public IFSTextFileInputStream(AS400 system,
IFSJavaFile file,
int shareOption)
throws AS400SecurityException,
IOException
system - The AS400 that contains the file.file - The file to be opened for reading.shareOption - Indicates how users can access the file. AS400SecurityException - If a security or authority error occurs.
IOException - If an error occurs while communicating with the system.public IFSTextFileInputStream(IFSFileDescriptor fd)
fd - The file descriptor to be opened for reading.| Method Detail |
|---|
public String read(int length)
throws IOException
length - The number of characters to read from the stream.
IOException - If an error occurs while communicating with the system.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||