com.sun.xfile
Class XFileInputStream
InputStream
com.sun.xfile.XFileInputStream
public class XFileInputStream
extends InputStream
An XFile input stream is an input stream for reading data from an
XFile
.
XFileInputStream(String name) - Creates an input file stream to read from a file with the
specified name.
|
XFileInputStream(XFile xfile) - Creates an input file stream to read from the specified
XFile object.
|
int | available() - Returns the number of bytes yet to be read from this file.
|
void | close() - Closes this file input stream and releases any system resources
associated with the stream.
|
int | read() - Reads a byte of data from this XFile.
|
int | read(b[] ) - Reads up to
b.length bytes of data from this file
into an array of bytes.
|
int | read(b[] , int off, int len) - Reads up to
len bytes of data from this file
into an array of bytes.
|
long | skip(long n) - Skips over and discards
n bytes of data from the
file.
|
XFileInputStream
public XFileInputStream(String name)
throws IOException
Creates an input file stream to read from a file with the
specified name.
name
- the system-dependent file name.
XFileInputStream
public XFileInputStream(XFile xfile)
throws IOException
Creates an input file stream to read from the specified
XFile
object.
xfile
- the file to be opened for reading.
available
public int available()
throws IOException
Returns the number of bytes yet to be read from this file.
- the number of bytes yet to be read from this file
without blocking.
close
public void close()
throws IOException
Closes this file input stream and releases any system resources
associated with the stream.
After the file is closed further I/O operations may
throw IOException.
read
public int read()
throws IOException
Reads a byte of data from this XFile.
- the next byte of data, or
-1
if the end of the file is reached.
read
public int read(b[] )
throws IOException
Reads up to b.length
bytes of data from this file
into an array of bytes.
- the total number of bytes read into the buffer, or
-1
if there is no more data because
the end of the file has been reached.
read
public int read(b[] ,
int off,
int len)
throws IOException
Reads up to len
bytes of data from this file
into an array of bytes.
off
- the start offset of the data.len
- the maximum number of bytes read.
- the total number of bytes read into the buffer, or
-1
if there is no more data because
the end of the file has been reached.
skip
public long skip(long n)
throws IOException
Skips over and discards n
bytes of data from the
file.
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.
n
- the number of bytes to be skipped.
- the actual number of bytes skipped.