public class BoundedOutputStreamWriter
extends java.io.BufferedWriter
BufferedWriter that wraps an OutputStreamWriter and automatically flushes it when flushing its internal buffer.
It enables to wrap an OutputStream as a Writer but with a faster feedback than a default
OutputStreamWriter which uses a 8k buffer by default (encapsulated).| Modifier and Type | Field and Description |
|---|---|
private int |
bufferSize |
private int |
writtenSinceLastFlush |
| Constructor and Description |
|---|
BoundedOutputStreamWriter(java.io.OutputStream outputStream,
java.nio.charset.Charset charset,
int maxSize) |
| Modifier and Type | Method and Description |
|---|---|
private void |
autoFlush() |
void |
write(char[] cbuf,
int off,
int len) |
void |
write(int c) |
void |
write(java.lang.String s,
int off,
int len) |
private final int bufferSize
private int writtenSinceLastFlush
public BoundedOutputStreamWriter(java.io.OutputStream outputStream,
java.nio.charset.Charset charset,
int maxSize)
public void write(java.lang.String s,
int off,
int len)
throws java.io.IOException
write in class java.io.BufferedWriterjava.io.IOExceptionpublic void write(char[] cbuf,
int off,
int len)
throws java.io.IOException
write in class java.io.BufferedWriterjava.io.IOExceptionpublic void write(int c)
throws java.io.IOException
write in class java.io.BufferedWriterjava.io.IOExceptionprivate void autoFlush()
throws java.io.IOException
java.io.IOExceptionCopyright © 2014–2026 The Apache Software Foundation. All rights reserved.