Code example for ByteArrayOutputStream

Methods: reset, toByteArray

0
        bOut.write(in, inOff, len);
    } 
 
    public int doFinal(byte[] out, int outOff)
    { 
        byte[] res = bOut.toByteArray();
 
        System.arraycopy(res, 0, out, outOff, res.length);
 
        reset(); 
         
        return res.length;
    } 
 
    public void reset() 
    { 
        bOut.reset();
    } 
}