Package com.aoindustries.io
Class FifoFileOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- com.aoindustries.io.FifoFileOutputStream
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
public class FifoFileOutputStream extends OutputStream
- 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.longavailable()Gets the number of bytes that may be written before the queue is full and blocks writes.voidclose()voidflush()Flushes all updates to this file to the underlying storage device.longgetWriteBytes()Gets the number of bytes written to this stream.longgetWriteCount()Gets the number of writes performed on this stream.voidwrite(byte[] b)voidwrite(byte[] b, int off, int len)voidwrite(int b)
-
-
-
Method Detail
-
getWriteCount
public long getWriteCount()
Gets the number of writes performed on this stream.
-
getWriteBytes
public long getWriteBytes()
Gets the number of bytes written to this stream.
-
addStats
protected void addStats(long bytes)
Adds to the stats of this stream.
-
write
public void write(int b) throws IOException- Specified by:
writein classOutputStream- Throws:
IOException
-
write
public void write(byte[] b) throws IOException- Overrides:
writein classOutputStream- Throws:
IOException
-
write
public void write(byte[] b, int off, int len) throws IOException- Overrides:
writein classOutputStream- Throws:
IOException
-
flush
public void flush() throws IOExceptionFlushes all updates to this file to the underlying storage device. This is performed byRandomAccessFile.getChannel().force(true).- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException- See Also:
FifoFile.flush()
-
available
public long available() throws IOExceptionGets the number of bytes that may be written before the queue is full and blocks writes.- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException- See Also:
FifoFile.close()
-
-