org.codehaus.groovy.grails.web.util
Class BoundedCharsAsEncodedBytesCounter
java.lang.Object
org.codehaus.groovy.grails.web.util.BoundedCharsAsEncodedBytesCounter
public class BoundedCharsAsEncodedBytesCounter
- extends Object
Counts chars encoded as bytes up to a certain limit (capacity of byte buffer).
size() returns the number of bytes, it will return -1 if the capacity was
reached or an error occurred.
this class is useful for calculating the content length of a
HttpServletResponse before the response has been committed
- Author:
- Lari Hotari, Sagire Software Oy
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BoundedCharsAsEncodedBytesCounter
public BoundedCharsAsEncodedBytesCounter(int capacity,
String encoding)
update
public void update(String str)
update
public void update(char[] buf)
update
public void update(char[] buf,
int off,
int len)
size
public int size()
getCountingWriter
public Writer getCountingWriter()
Copyright (c) 2005-2009 The Grails project