if (len <= 0) return bb; else bb.setOffset(len);
int sublen = is.read(bb.getBuffer(), bb.getOffset(), bb.getLength() - bb.getOffset());  if (sublen <= 0) return bb; else { length += sublen; bb.setOffset(length); }
  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);    }  }