Code example for ByteBuffer

Methods: rewind

0
     * allocated buffer space. 
     *  
     * @see java.io.ByteArrayInputStream#count 
     */ 
    public void reset() { 
        buffer.rewind();
    } 
 
    /** 
     * Returns the current size of the buffer. 
     *  
     * @return the value of the <code>count</code> field, which is the number of 
     *         valid bytes in this output stream. 
     * @see java.io.ByteArrayOutputStream#count 
     */ 
    public int size() { 
        return buffer.position();
    } 
 
    /** 
     * Closing a <tt>ByteBufferOutputStream</tt> has no effect. The methods in