FileDocCategorySizeDatePackage
ChunkedOutputStream.javaAPI DocApache Axis 1.42027Sat Apr 22 18:57:28 BST 2006org.apache.axis.transport.http

ChunkedOutputStream

public class ChunkedOutputStream extends FilterOutputStream
author
Rick Rineholt

Fields Summary
boolean
eos
static final byte[]
CRLF
static final byte[]
LAST_TOKEN
Constructors Summary
private ChunkedOutputStream()


      
        super(null);
    
public ChunkedOutputStream(OutputStream os)

        super(os);
    
Methods Summary
public voidclose()

        eos();
        out.close();
    
public voideos()

        synchronized (this) {
            if (eos) return;
            eos = true;
        }
        out.write(LAST_TOKEN);
        out.flush();
    
public voidwrite(int b)

        write(new byte[] {(byte) b}, 0, 1);
    
public voidwrite(byte[] b)

        write(b, 0, b.length);
    
public voidwrite(byte[] b, int off, int len)


       
         
         
          
        if (len == 0) return;
           
        out.write((Integer.toHexString(len)).getBytes());
        out.write(CRLF);
        out.write(b, off, len);
        out.write(CRLF);