ePOST API

rice.email.proxy.util
Class LimitedStringWriter

java.lang.Object
  extended by java.io.Writer
      extended by java.io.StringWriter
          extended by rice.email.proxy.util.LimitedStringWriter
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, java.lang.Appendable

public class LimitedStringWriter
extends java.io.StringWriter


Field Summary
protected  int capacity
          The capacity of the writer
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
LimitedStringWriter(int capacity)
          Constructor which takes a maximum capacity
 
Method Summary
 void write(char[] c, int off, int len)
          First checks to see if this will put us over capacity, and if so, throws a StringWriterOverflowException.
 void write(int c)
          First checks to see if this will put us over capacity, and if so, throws a StringWriterOverflowException.
 void write(java.lang.String str)
          First checks to see if this will put us over capacity, and if so, throws a StringWriterOverflowException.
 void write(java.lang.String str, int off, int len)
          First checks to see if this will put us over capacity, and if so, throws a StringWriterOverflowException.
 
Methods inherited from class java.io.StringWriter
append, append, append, close, flush, getBuffer, toString
 
Methods inherited from class java.io.Writer
write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

capacity

protected int capacity
The capacity of the writer

Constructor Detail

LimitedStringWriter

public LimitedStringWriter(int capacity)
Constructor which takes a maximum capacity

Parameters:
capacity - The capacity
Method Detail

write

public void write(int c)
First checks to see if this will put us over capacity, and if so, throws a StringWriterOverflowException. Otherwise, proceeds as normal

Overrides:
write in class java.io.StringWriter
Parameters:
c - The character

write

public void write(char[] c,
                  int off,
                  int len)
First checks to see if this will put us over capacity, and if so, throws a StringWriterOverflowException. Otherwise, proceeds as normal

Overrides:
write in class java.io.StringWriter
Parameters:
c - The array
off - The offset
len - The length

write

public void write(java.lang.String str)
First checks to see if this will put us over capacity, and if so, throws a StringWriterOverflowException. Otherwise, proceeds as normal

Overrides:
write in class java.io.StringWriter
Parameters:
str - The string

write

public void write(java.lang.String str,
                  int off,
                  int len)
First checks to see if this will put us over capacity, and if so, throws a StringWriterOverflowException. Otherwise, proceeds as normal

Overrides:
write in class java.io.StringWriter
Parameters:
str - The string
off - The offset
len - The length

ePOST API

Copyright © 2001-2005 - Rice Pastry.