public class LogInputStream extends InputStream
InputStream| Constructor and Description |
|---|
LogInputStream(InputStream in,
int length)
Creates a log input file with the specified input stream.
|
| Modifier and Type | Method and Description |
|---|---|
int |
available()
Returns the number of bytes that can be read without blocking.
|
void |
close()
Closes the input stream.
|
protected void |
finalize()
Closes the stream when garbage is collected.
|
int |
read()
Reads a byte of data.
|
int |
read(byte[] b)
Reads data into an array of bytes.
|
int |
read(byte[] b,
int off,
int len)
Reads data into an array of bytes.
|
long |
skip(long n)
Skips n bytes of input.
|
mark, markSupported, resetpublic LogInputStream(InputStream in, int length) throws IOException
in - the input streamlength - the total number of bytes allowed to be readIOException - If an I/O error has occurred.public int read()
throws IOException,
LogException
read in class InputStreamLogException - Attempt to read past end of log.IOException - If an I/O error has occurred.public int read(byte[] b)
throws IOException,
LogException
read in class InputStreamb - the buffer into which the data is readLogException - Attempt to read past end of log.IOException - If an I/O error has occurred.public int read(byte[] b,
int off,
int len)
throws IOException,
LogException
read in class InputStreamb - the buffer into which the data is readoff - the start offset of the datalen - the maximum number of bytes readLogException - Attempt to read past end of log.IOException - If an I/O error has occurred.public long skip(long n)
throws IOException,
LogException
skip in class InputStreamn - the number of bytes to be skippedLogException - Attempt to read past end of log.IOException - If an I/O error has occurred.public int available()
available in class InputStreampublic void close()
close in interface Closeableclose in interface AutoCloseableclose in class InputStreamprotected void finalize()
throws IOException
finalize in class ObjectIOExceptionCopyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.