public byte[] toByteArray(){
  byte[] copy=new byte[outputPos];
  System.arraycopy(bytes,0,copy,0,outputPos);
  return copy;
}

public byte [ ] toByteArray ( ) { byte [ ] copy = new byte [ outputPos ] ; System . arraycopy ( bytes , 0 , copy , 0 , outputPos ) ; return copy ; }
returns a copy of the bytes written to this stream .
