code: public byte[] toByteArray() {
  		
  		if (this.pos == this.length)
  			return this.buffer;
  		else {
  			byte[] res = new byte[this.pos];
  			System.arraycopy(this.buffer, 0, res, 0, this.pos);
  			return res;
  		}
  	}
docs: Returns the written to the stream data as a byte array
  
  @return