|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.xce.io.FileInputStream
The implementation of simple file input stream. This class privides functions to read from file.
You can open stdin(standard input stream) by a constructor:
new FileInputStream(XFile.STDIN);
And you can also open any file to read by following constructor:
new FileInputStream("FileName");
Constructor Summary | |
FileInputStream(int fd)
A constructor to open STDIN(standard input stream). |
|
FileInputStream(com.xce.io.String name)
A constructor to open specified file to read. |
|
FileInputStream(XFile file)
|
Method Summary | |
int |
available()
Checks how much bytes left to read. |
void |
close()
Close this file. |
void |
mark(int readlimit)
Mark current position for future use. |
boolean |
markSupported()
FileInputStream supports mark. so this function always return true |
int |
read()
Read a byte |
int |
read(byte[] b)
same as read(b, 0, b.length) |
int |
read(byte[] b,
int off,
int len)
Read from file to b with length len . |
void |
reset()
Moves to marked position. |
long |
skip(long n)
skip n bytes from file. |
Constructor Detail |
public FileInputStream(int fd)
fd
- must be FileInputStream.STDINIllegalArgumentException
- if fd
is not STDIN
public FileInputStream(com.xce.io.String name) throws java.io.IOException
name
- the file name to read.java.io.IOException
- public FileInputStream(XFile file) throws java.io.IOException
Method Detail |
public int available() throws java.io.IOException
public void close() throws java.io.IOException
public void mark(int readlimit)
public boolean markSupported()
true
public int read() throws java.io.IOException
public int read(byte[] b) throws java.io.IOException
read(b, 0, b.length)
public int read(byte[] b, int off, int len) throws java.io.IOException
b
with length len
.public void reset() throws java.io.IOException
public long skip(long n) throws java.io.IOException
n
bytes from file.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |