| Method from com.opensymphony.module.sitemesh.util.CharArrayWriter Detail: |
public void close() {
}
Close the stream. This method does not release the buffer, since its
contents might still be required. |
public void flush() {
}
|
public void reset() {
count = 0;
}
Resets the buffer so that you can use it again without
throwing away the already allocated buffer. |
public int size() {
return count;
}
Returns the current size of the buffer. |
public char[] toCharArray() {
char newbuf[] = new char[count];
System.arraycopy(buf, 0, newbuf, 0, count);
return newbuf;
}
Returns a copy of the input data. |
public String toString() {
return new String(buf, 0, count);
}
Converts input data to a string. |
public void write(int c) {
int newcount = count + 1;
if (newcount > buf.length) {
char newbuf[] = new char[Math.max(buf.length < < 1, newcount)];
System.arraycopy(buf, 0, newbuf, 0, count);
buf = newbuf;
}
buf[count] = (char)c;
count = newcount;
}
Writes a character to the buffer. |
public void write(char[] c,
int off,
int len) {
if ((off < 0) || (off > c.length) || (len < 0) ||
((off + len) > c.length) || ((off + len) < 0)) {
throw new IndexOutOfBoundsException();
} else if (len == 0) {
return;
}
int newcount = count + len;
if (newcount > buf.length) {
char newbuf[] = new char[Math.max(buf.length < < 1, newcount)];
System.arraycopy(buf, 0, newbuf, 0, count);
buf = newbuf;
}
System.arraycopy(c, off, buf, count, len);
count = newcount;
}
Writes characters to the buffer. |
public void write(String str,
int off,
int len) {
int newcount = count + len;
if (newcount > buf.length) {
char newbuf[] = new char[Math.max(buf.length < < 1, newcount)];
System.arraycopy(buf, 0, newbuf, 0, count);
buf = newbuf;
}
str.getChars(off, off + len, buf, count);
count = newcount;
}
Write a portion of a string to the buffer. |
public void writeTo(Writer out) throws IOException {
out.write(buf, 0, count);
}
Writes the contents of the buffer to another character stream. |