com.trendmicro.grid.acl.ds.jpa.util
Class LimitedWriter

java.lang.Object
  extended by java.io.Writer
      extended by java.io.FilterWriter
          extended by com.trendmicro.grid.acl.ds.jpa.util.LimitedWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable

public class LimitedWriter
extends FilterWriter

Is a filter stream that limits the maximum amount of characters written to the underlying stream.

Version:
1.0
Author:
juergen_kellerer, 2010-07-14

Nested Class Summary
static class LimitedWriter.OutOfBounds
           
 
Field Summary
 
Fields inherited from class java.io.FilterWriter
out
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
LimitedWriter(Writer out, long limit)
           
 
Method Summary
 void write(char[] cbuf, int off, int len)
          
 void write(int c)
          
 void write(String str, int off, int len)
          
 
Methods inherited from class java.io.FilterWriter
close, flush
 
Methods inherited from class java.io.Writer
append, append, append, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LimitedWriter

public LimitedWriter(Writer out,
                     long limit)
Method Detail

write

public void write(int c)
           throws IOException

Overrides:
write in class FilterWriter
Throws:
IOException

write

public void write(char[] cbuf,
                  int off,
                  int len)
           throws IOException

Overrides:
write in class FilterWriter
Throws:
IOException

write

public void write(String str,
                  int off,
                  int len)
           throws IOException

Overrides:
write in class FilterWriter
Throws:
IOException