bb.prepareReadBuffer();  int len = is.read(bb.getBuffer(), bb.getOffset(), bb.getLength() - bb.getOffset());
bb.prepareReadBuffer();
  public BinaryValue toBinaryValue(Env env)  {    try {      InputStream is = toInputStream();      BinaryBuilderValue bb = new BinaryBuilderValue();      while (true) {	bb.prepareReadBuffer();      	int len = is.read(bb.getBuffer(),			  bb.getOffset(),			  bb.getLength() - bb.getOffset());	if (len <= 0)	  return bb;	else	  bb.setOffset(len);      }    } catch (IOException e) {      throw new QuercusException(e);    }  }