else os.print(data.toString());
else { InputStream is = data.toInputStream();  dataWritten += os.write(is, Integer.MAX_VALUE);  is.close(); }
  public Value file_put_contents(Env env,                                 String filename,                                 Value data,                                 @Optional int flags,                                 @Optional Value context)  {    // php/1634    try {      // XXX: bug862, flags check for FILE_USE_INCLUDE_PATH, FILE_APPEND, LOCK_EX      boolean useIncludePath = (flags & FILE_USE_INCLUDE_PATH) != 0;      String mode = (flags & FILE_APPEND) != 0 ? "a" : "w";            BinaryStream s = fopen(env, filename, mode, useIncludePath, context);      if (! (s instanceof BinaryOutput))	return BooleanValue.FALSE;      BinaryOutput os = (BinaryOutput) s;      try {	long dataWritten = 0;	if (data instanceof ArrayValue) {	  for (Value item : ((ArrayValue) data).values()) {	    os.print(item.toString());	  }	}	else	  os.print(data.toString());	return new LongValue(dataWritten);      } finally {	os.close();      }    } catch (IOException e) {      throw new QuercusModuleException(e);    }  }