Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2004-2010 Oracle Corporation. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at Contributors: Kohsuke Kawaguchi /
package; that spools the output and writes to another later.

Kohsuke Kawaguchi
public /*for now, until Hudson migration completes*/ final class CharSpool extends Writer {
    private List<char[]> buf;
    private char[] last = new char[1024];
    private int pos;
    public void write(char cbuf[], int offint len) {
        while(len>0) {
            int sz = Math.min(.-,len);
            len -= sz;
            off += sz;
             += sz;
    private void renew() {
             = new LinkedList<char[]>();
         = new char[1024];
         = 0;
    public void write(int c) {
        [++] = (char)c;
    public void flush() {
        // noop
    public void close() {
        // noop
    public void writeTo(Writer wthrows IOException {
        if(!=null) {
            for (char[] cb : ) {
New to GrepCode? Check out our FAQ X