it.unimi.dsi.fastutil.io
Class FastBufferedOutputStream
java.lang.Object
java.io.OutputStream
it.unimi.dsi.fastutil.io.FastBufferedOutputStream
- All Implemented Interfaces:
- Closeable, Flushable
public class FastBufferedOutputStream
- extends OutputStream
Lightweight, unsynchronized output stream buffering class.
This class provides buffering for output streams, but all methods are unsynchronised.
- Since:
- 4.4
Field Summary |
static int |
DEFAULT_BUFFER_SIZE
The default size of the internal buffer in bytes (8Ki). |
Method Summary |
void |
close()
|
void |
flush()
|
void |
write(byte[] b,
int offset,
int length)
|
void |
write(int b)
|
DEFAULT_BUFFER_SIZE
public static final int DEFAULT_BUFFER_SIZE
- The default size of the internal buffer in bytes (8Ki).
- See Also:
- Constant Field Values
FastBufferedOutputStream
public FastBufferedOutputStream(OutputStream os,
int bufferSize)
- Creates a new fast buffered output stream by wrapping a given output stream with a given buffer size.
- Parameters:
os
- an output stream to wrap.bufferSize
- the size in bytes of the internal buffer.
FastBufferedOutputStream
public FastBufferedOutputStream(OutputStream os)
- Creates a new fast buffered ouptut stream by wrapping a given output stream with a buffer of
DEFAULT_BUFFER_SIZE
bytes.
- Parameters:
os
- an output stream to wrap.
write
public void write(int b)
throws IOException
- Specified by:
write
in class OutputStream
- Throws:
IOException
write
public void write(byte[] b,
int offset,
int length)
throws IOException
- Overrides:
write
in class OutputStream
- Throws:
IOException
flush
public void flush()
throws IOException
- Specified by:
flush
in interface Flushable
- Overrides:
flush
in class OutputStream
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close
in interface Closeable
- Overrides:
close
in class OutputStream
- Throws:
IOException