public class BoundedWriter
extends java.io.Writer
| Modifier and Type | Class and Description |
|---|---|
static class |
BoundedWriter.WriterBoundReachedException |
| Modifier and Type | Field and Description |
|---|---|
protected long |
currentWrittenChars |
protected long |
maxWrittenChars |
protected java.io.Writer |
writer |
| Constructor and Description |
|---|
BoundedWriter(java.io.Writer writer,
long maxAppendedChars) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush() |
void |
write(char[] cbuf,
int off,
int len)
Writes a portion of an array of characters.
|
protected final java.io.Writer writer
protected final long maxWrittenChars
protected long currentWrittenChars
public void write(char[] cbuf,
int off,
int len)
throws java.io.IOException
write in class java.io.Writercbuf - Array of charactersoff - Offset from which to start writing characterslen - Number of characters to writeBoundedWriter.WriterBoundReachedException - if this write would exceed the maximum number of written characters to this writer.java.io.IOException - if this the underlying writer throws an IOException.public void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.Writerjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.Writerjava.io.IOException