org.torweg.pulse.vfs
Class VFInputStream
java.lang.Object
java.io.InputStream
org.torweg.pulse.vfs.VFInputStream
- All Implemented Interfaces:
- java.io.Closeable
public final class VFInputStream
- extends java.io.InputStream
an InputStream to read from VirtualFiles.
- Version:
- $Revision: 1429 $
- Author:
- Thomas Weber
|
Constructor Summary |
protected |
VFInputStream(java.io.InputStream in)
creates a new VFInputStream from the given
InputStream. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
VFInputStream
protected VFInputStream(java.io.InputStream in)
- creates a new
VFInputStream from the given
InputStream.
- Parameters:
in - the underlying InputStream
available
public int available()
throws java.io.IOException
- Overrides:
available in class java.io.InputStream
- Returns:
- the number of bytes that can be read from this input stream
without blocking
- Throws:
java.io.IOException - if an I/O error occurs- See Also:
InputStream.available()
close
public void close()
throws java.io.IOException
- Specified by:
close in interface java.io.Closeable- Overrides:
close in class java.io.InputStream
- Throws:
java.io.IOException - if an I/O error occurs- See Also:
InputStream.close()
mark
public void mark(int readlimit)
- Overrides:
mark in class java.io.InputStream
- Parameters:
readlimit - the maximum limit of bytes that can be read before the mark
position becomes invalid- See Also:
InputStream.mark(int)
markSupported
public boolean markSupported()
- Overrides:
markSupported in class java.io.InputStream
- Returns:
true if this stream instance supports the mark and
reset methods; false otherwise.- See Also:
InputStream.markSupported()
reset
public void reset()
throws java.io.IOException
- Overrides:
reset in class java.io.InputStream
- Throws:
java.io.IOException - if this stream has not been marked or if the mark has been
invalidated- See Also:
InputStream.reset()
read
public int read(byte[] b)
throws java.io.IOException
- Overrides:
read in class java.io.InputStream
- Parameters:
b - the buffer into which the data is read
- Returns:
- the total number of bytes read into the buffer, or -1 is there is
no more data because the end of the stream has been reached.
- Throws:
java.io.IOException - on I/O errors- See Also:
InputStream.read(byte[])
read
public int read(byte[] b,
int off,
int len)
throws java.io.IOException
- Overrides:
read in class java.io.InputStream
- Parameters:
b - the buffer into which the data is readoff - the start offset in array b at which the data is writtenlen - the maximum number of bytes to read
- Returns:
- the total number of bytes read into the buffer, or -1 is there is
no more data because the end of the stream has been reached.
- Throws:
java.io.IOException - on I/O errors- See Also:
InputStream.read(byte[], int, int)
skip
public long skip(long n)
throws java.io.IOException
- Overrides:
skip in class java.io.InputStream
- Parameters:
n - the number of bytes to be skipped
- Returns:
- the actual number of bytes skipped
- Throws:
java.io.IOException - on I/O errors- See Also:
InputStream.skip(long)
read
public int read()
throws java.io.IOException
- Specified by:
read in class java.io.InputStream
- Returns:
- the next byte from the
VFInputStream
- Throws:
java.io.IOException - on errors reading from the stream- See Also:
InputStream.read()