|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.InputStream
com.gc.iotools.stream.is.FileBufferedInputStream
@Deprecated public class FileBufferedInputStream
A FileBufferedInputStream adds functionality to another input
stream namely, the ability to buffer the input and to support the
mark and reset methods.
It is very similar to java.io.BufferInputStream but the buffer
is kept on disk instead of memory. This is for supporting mark
and reset over a large amount of data where a standard
BufferInputStream takes too much memory.
It also adds the functionality of marking an InputStream without
specifying a mark length, thus allowing a reset after an
indefinite length of bytes has been read. Check mark for details.
It's best used when a large sequential read of an
InputStream has to be performed and then the content of the
stream must be available again. Since it's disk based performances of
reset method are low. When frequent
reset are needed a cache in memory should be used
to speed up the process.
BufferedInputStream,
RandomAccessInputSteam| Constructor Summary | |
|---|---|
FileBufferedInputStream(InputStream source)
Deprecated. Creates a FileBufferedInputStream and saves its argument,
the input stream source for later use. |
|
| Method Summary | |
|---|---|
int |
available()
Deprecated. |
void |
close()
Deprecated. Closes the underlying InputStream and cleans up temporary
files eventually created. |
protected void |
finalize()
Deprecated. |
void |
mark(int markLimit)
Deprecated. Marks the current position in this input stream. |
boolean |
markSupported()
Deprecated. Tests if this input stream supports the mark and
reset methods. |
int |
read()
Deprecated. See the general contract of the read method of
InputStream. |
int |
read(byte[] b,
int off,
int len)
Deprecated. |
void |
reset()
Deprecated. |
long |
skip(long n)
Deprecated. |
| Methods inherited from class java.io.InputStream |
|---|
read |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileBufferedInputStream(InputStream source)
FileBufferedInputStream and saves its argument,
the input stream source for later use.
source - the underlying input stream.| Method Detail |
|---|
public int available()
throws IOException
available in class InputStreamIOException
public void close()
throws IOException
InputStream and cleans up temporary
files eventually created.
close in interface Closeableclose in class InputStreamIOException - if an I/O error occurs.InputStream.close()public void mark(int markLimit)
Marks the current position in this input stream. A subsequent call to the
reset method repositions this stream at the last marked
position so that subsequent reads re-read the same bytes.
This method extends the original behavior of the class
InputStream allowing to use indefinite marking.
readLimit> 0 The readLimit arguments
tells this input stream to allow that many bytes to be read before the
mark position gets invalidated.readLimit == 0 Invalidate the all the current marks and
clean up the temporary files.readLimit < 0 Set up an indefinite mark: reset can
be invoked regardless on how many bytes have been read.
mark in class InputStreammarkLimit - the maximum limit of bytes that can be read before the mark
position becomes invalid. If negative allows indefinite
marking (the mark never becomes invalid).InputStream.reset()public boolean markSupported()
mark and
reset methods.
markSupported in class InputStreamtrue for this class.InputStream.markSupported()
public int read()
throws IOException
read method of
InputStream.
read in class InputStream-1 if the end of the
stream is reached.
IOException - if an I/O error occurs.InputStream.read()
public int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamIOException
public void reset()
throws IOException
reset in class InputStreamIOException
public long skip(long n)
throws IOException
skip in class InputStreamIOException
protected void finalize()
throws Throwable
finalize in class ObjectThrowable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||