Package com.aoindustries.io
Class FifoFileInputStream
- java.lang.Object
-
- java.io.InputStream
-
- com.aoindustries.io.FifoFileInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class FifoFileInputStream extends InputStream
- Author:
- AO Industries, Inc.
- See Also:
FifoFile
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddStats(long bytes)Adds to the stats of this stream.intavailable()Determines the number of bytes that may be read without blocking.voidclose()longgetReadBytes()Gets the number of bytes read from this stream.longgetReadCount()Gets the number of reads performed on this stream.intread()Reads data from the file, blocks until the data is available.intread(byte[] b)Reads data from the file, blocks until at least one byte is available.intread(byte[] b, int off, int len)Reads data from the file, blocks until at least one byte is available.longskip(long n)Skips data in the queue, blocks until at least one byte is skipped.-
Methods inherited from class java.io.InputStream
mark, markSupported, reset
-
-
-
-
Method Detail
-
getReadCount
public long getReadCount()
Gets the number of reads performed on this stream.
-
getReadBytes
public long getReadBytes()
Gets the number of bytes read from this stream.
-
addStats
protected void addStats(long bytes)
Adds to the stats of this stream.
-
read
public int read() throws IOExceptionReads data from the file, blocks until the data is available.- Specified by:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] b) throws IOExceptionReads data from the file, blocks until at least one byte is available.- Overrides:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOExceptionReads data from the file, blocks until at least one byte is available.- Overrides:
readin classInputStream- Throws:
IOException
-
skip
public long skip(long n) throws IOExceptionSkips data in the queue, blocks until at least one byte is skipped.- Overrides:
skipin classInputStream- Throws:
IOException
-
available
public int available() throws IOExceptionDetermines the number of bytes that may be read without blocking.- Overrides:
availablein classInputStream- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException- See Also:
FifoFile.close()
-
-