public class LimitedWriter extends java.io.Writer
Writer that delegates to another Writer until a given
maximum number of characters has been written. It then writes a final
ellipsis and stops delegating.| Constructor and Description |
|---|
LimitedWriter(java.io.Writer delegate,
int maxChars) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush() |
java.lang.String |
toString() |
void |
write(char[] buffer,
int offset,
int length) |
public LimitedWriter(java.io.Writer delegate, int maxChars)
public void write(char[] buffer, int offset, int length) throws java.io.IOException
write in class java.io.Writerjava.io.IOExceptionpublic 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.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Object