|
JAFS API v2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.InputStream | +--org.openafs.jafs.FileInputStream
This class is a file input stream for files within AFS.
It is an input stream for reading data from a
.
File
File
,
FileOutputStream
,
FileInputStream
Constructor Summary | |
FileInputStream(File file)
Creates a FileInputStream by
opening a connection to an actual AFS file,
the file represented by file file
in the AFS file system. |
|
FileInputStream(String name)
Creates a FileInputStream by
opening a connection to an actual AFS file,
the file named by the path name name
in the AFS file system. |
Method Summary | |
void |
close()
Closes this file input stream and releases any system resources associated with the stream. |
int |
read()
Reads the next byte of data from this input stream. |
int |
read(byte[] b)
Reads up to b.length bytes of data from this input
stream into an array of bytes. |
int |
read(byte[] b,
int off,
int len)
Reads up to len bytes of data from this input stream
into an array of bytes. |
long |
skip(long n)
Skips over and discards n bytes of data from the
input stream. |
Methods inherited from class java.io.InputStream |
available, mark, markSupported, reset |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FileInputStream(String name) throws AFSFileException
FileInputStream
by
opening a connection to an actual AFS file,
the file named by the path name name
in the AFS file system.
name
- the name of the file to read from
AFSFileException
- If an AFS specific error occurs,
if the file does not, or cannot be opened for any
other reason, including authorization.public FileInputStream(File file) throws AFSFileException
FileInputStream
by
opening a connection to an actual AFS file,
the file represented by file file
in the AFS file system.
file
- an AFS file object representing a file to read from
AFSFileException
- If an AFS specific error occurs,
if the file does not, or cannot be opened for any
other reason, including authorization.Method Detail |
public int read() throws AFSFileException
int
in the range
0
to 255
. If no byte is available
because the end of the stream has been reached, the value
-1
is returned. This method blocks until input data
is available, the end of the stream is detected, or an exception
is thrown.
This method simply performs in.read()
and returns
the result.
read
in class InputStream
-1
if the end of the
stream is reached.
AFSFileException
- if an I/O or other file related error occurs.FileInputStream.read()
public int read(byte[] b) throws AFSFileException
b.length
bytes of data from this input
stream into an array of bytes. This method blocks until some input
is available.
read
in class InputStream
b
- the buffer into which the data is read.
-1
if there is no more data because the end of
the file has been reached.
AFSFileException
- if an I/O or other file related error occurs.public int read(byte[] b, int off, int len) throws AFSFileException
len
bytes of data from this input stream
into an array of bytes. This method blocks until some input is
available.
read
in class InputStream
b
- the buffer into which the data is read.off
- the start offset of the data.len
- the maximum number of bytes read.
-1
if there is no more data because the end of
the file has been reached.
AFSFileException
- if an I/O or other file related error occurs.public long skip(long n) throws AFSFileException
n
bytes of data from the
input stream. The skip
method may, for a variety of
reasons, end up skipping over some smaller number of bytes,
possibly 0
. The actual number of bytes skipped is returned.
skip
in class InputStream
n
- the number of bytes to be skipped.
AFSFileException
- if an I/O or other file related error occurs.public void close() throws AFSFileException
close
in class InputStream
AFSFileException
- if an I/O or other file related error occurs.
|
JAFS API v2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |