Code example for ByteArrayOutputStream

Methods: resetsizetoByteArray

0
    /** 
     * Flush OutputStream 
     */ 
    @Override 
    public void flush() throws IOException { 
        if (buffer.size() > 0) {
            os.write(buffer.toByteArray());
            buffer.reset();
            os.flush();
        } 
    } 
 
    /** 
     * reads add empties the BZip2Deflate buffer 
     * 
     * @return the number of bytes read into the local output buffer. 
     */ 
    private int deflate() { 
        byte[] b = new byte[bufferMax];
        int c;