public byte[] toByteArray(){
  final byte[] b=new byte[this.len];
  if (this.len > 0) {
    System.arraycopy(this.buffer,0,b,0,this.len);
  }
  return b;
}

public byte [ ] toByteArray ( ) { final byte [ ] b = new byte [ this . len ] ; if ( this . len > 0 ) { System . arraycopy ( this . buffer , 0 , b , 0 , this . len ) ; } return b ; }
converts the content of this buffer to an array of bytes .
