Code example for ByteBuffer

Methods: put, remaining

0
    } 
 
    public void write(byte[] b, int off, int len){
	ByteBuffer cur = _need( 1 );
 
	int toWrite = Math.min( len , cur.remaining() );
	cur.put( b , off , toWrite );
	 
	if ( toWrite == len )
	    return; 
 
	write( b , off + toWrite , len - toWrite );
    } 
 
    public void write(int b){
	_need(1).put((byte)b);
    } 
 
    public List<ByteBuffer> getBuffers(){
	return _lst;
    }