Write a bracketed operand if necessary. Any operand whose human-readable
representation can contain whitespace must have brackets around it.

@param operand
@param enclosing
@param out
977731
public void visitBracketedExpression(Expr expr, Integer indent) {
		boolean needsBrackets = needsBrackets(expr);
		if (needsBrackets) {
			out.print("(");
		}
		visitExpression(expr, indent);
		if (needsBrackets) {
			out.print(")");
		}
	}
336987
private static void writeAscii(OutputAccessor out, CharSequence seq) {

        // We can use the _set methods as these not need to do any index checks and reference checks.
        // This is possible as we called ensureWritable(...) before.
        for (int i = 0; i < seq.length(); i++) {
            out.write((byte) seq.charAt(i));
        }
    }
798678
public static void write(ObjectOutput out, Class<?> cl) throws IOException {
        int dim;

        if (cl == null) {
            out.writeByte(-1);
        } else {
            dim = 0;
            while (cl.isArray()) {
                dim++;
                cl = cl.getComponentType();
            }

            if (dim > Byte.MAX_VALUE) {
                throw new RuntimeException("to many dimensions");
            }

            out.writeByte((byte) dim);
            out.writeUTF(cl.getName());
        }
    }
609352
void writeDouble(double value) throws IOException {
        if (Double.isNaN(value) || Double.isInfinite(value)) {
            output.append('"').append(Double.toString(value)).append('"');
        } else {
            output.append(Double.toString(value));
        }
    }
152963
@SuppressWarnings({ "unchecked", "TryWithIdenticalCatches" })
  public static void writeField(
      @NonNull Object value, @NonNull Class<?> enclosingClass,
      @NonNull Object target, @NonNull String field) {
    try {
      Field f = enclosingClass.getDeclaredField(field);
      f.setAccessible(true);
      f.set(target, value);
    } catch (NoSuchFieldException e) {
      throw new RuntimeException(e);
    } catch (IllegalAccessException e) {
      throw new RuntimeException(e);
    }
  }
787381
@GwtIncompatible("Unnecessary")
  @VisibleForTesting
  void writeOutput(
      Appendable out,
      Compiler compiler,
      String code,
      String wrapper,
      String codePlaceholder,
      @Nullable Function<String, String> escaper)
      throws IOException {
    int pos = wrapper.indexOf(codePlaceholder);
    if (pos != -1) {
      String prefix = "";

      if (pos > 0) {
        prefix = wrapper.substring(0, pos);
        out.append(prefix);
      }

      out.append(escaper == null ? code : escaper.apply(code));

      int suffixStart = pos + codePlaceholder.length();
      if (suffixStart != wrapper.length()) {
        // Something after placeholder?
        out.append(wrapper.substring(suffixStart));
      }
      // Make sure we always end output with a line feed.
      out.append('\n');

      // If we have a source map, adjust its offsets to match
      // the code WITHIN the wrapper.
      if (compiler != null && compiler.getSourceMap() != null) {
        compiler.getSourceMap().setWrapperPrefix(prefix);
      }

    } else {
      out.append(code);
      out.append('\n');
    }
  }
670878
public static void writeOutSilent(Expression value, BytecodeContext bc, int mode) throws TransformerException {
	Position start = value.getStart();
	Position end = value.getEnd();
	value.setStart(null);
	value.setEnd(null);
	value.writeOut(bc, mode);
	value.setStart(start);
	value.setEnd(end);
    }
456440
private LinkedHashSet<Formula> condenseOperandsOr(final Collection<? extends Formula> operands) {
    final LinkedHashSet<Formula> ops = new LinkedHashSet<>();
    this.cnfCheck = true;
    for (final Formula form : operands)
      if (form.type() == OR) {
        for (final Formula f : ((NAryOperator) form).operands) {
          this.addFormulaOr(ops, f);
          if (!this.formulaAdditionResult[0])
            return null;
          if (!this.formulaAdditionResult[1])
            this.cnfCheck = false;
        }
      } else {
        this.addFormulaOr(ops, form);
        if (!this.formulaAdditionResult[0])
          return null;
        if (!this.formulaAdditionResult[1])
          this.cnfCheck = false;
      }
    return ops;
  }
2247
@Override
    public void encode(OutputStream output, Indenter indenter) {
        encode(output, indenter, null);
    }
108375
public static void decodeSingle(final byte[] input, final int inoff,
                                    final byte[] output, final int outoff) {

        if (output == null) {
            throw new NullPointerException("output");
        }

        if (outoff < 0) {
            throw new IllegalArgumentException("outoff(" + outoff + ") < 0");
        }

        if (outoff >= output.length) {
            throw new IllegalArgumentException(
                "outoff(" + outoff + ") >= output.length(" + output.length
                + ")");
        }

        output[outoff] = (byte) decodeSingle(input, inoff);
    }
756569
@Override
  void visitEnclosingElement(ImageElement element,
      ImageElement key, String value)
      throws IOException {
    printIndents();
    write(element + " [" + key + " = " + value + "]\n");
    dc.incLevel();
  }
223290
public static void encodeSingle(final int input, final byte[] output,
                                    final int outoff) {

        if (output == null) {
            throw new NullPointerException("output");
        }

        if (outoff < 0) {
            throw new IllegalArgumentException("outoff(" + outoff + ") < 0");
        }

        if (outoff >= output.length - 1) {
            throw new IllegalArgumentException(
                "outoff(" + outoff + ") >= output.length(" + output.length
                + ") - 1");
        }

        output[outoff] = (byte) encodeHalf((input >> 4) & 0x0F);
        output[outoff + 1] = (byte) encodeHalf(input & 0x0F);
    }
785304
public static void indent(int num, StringBuilder out) {
        if (num <= SIXTY_FOUR) {
            out.append(SIXTY_FOUR_SPACES, 0, num);
            return;
        } else if (num <= 128){
            // avoid initializing loop counters if only one iteration
            out.append(SIXTY_FOUR_SPACES, 0, SIXTY_FOUR);
            out.append(SIXTY_FOUR_SPACES, 0, num - SIXTY_FOUR);
        } else {
            int times = num / SIXTY_FOUR;
            int rem = num % SIXTY_FOUR;
            for (int i = 0; i< times; i++) {
                out.append(SIXTY_FOUR_SPACES, 0, SIXTY_FOUR);
            }
            out.append(SIXTY_FOUR_SPACES, 0, rem);
            return;
        }
    }
1340319
private static void encodeInteger(ByteBuf out, int mask, int n, int i) {
        encodeInteger(out, mask, n, (long) i);
    }
723218
protected int writeEnclosingMethodAttribute(Name attributeName, ClassSymbol c) {
        if (c.owner.kind != MTH && // neither a local class
            c.name != names.empty) // nor anonymous
            return 0;

        int alenIdx = writeAttr(attributeName);
        ClassSymbol enclClass = c.owner.enclClass();
        MethodSymbol enclMethod =
            (c.owner.type == null // local to init block
             || c.owner.kind != MTH) // or member init
            ? null
            : (MethodSymbol)c.owner;
        databuf.appendChar(pool.put(enclClass));
        databuf.appendChar(enclMethod == null ? 0 : pool.put(nameType(c.owner)));
        endAttr(alenIdx);
        return 1;
    }
69345
private LinkedHashSet<Formula> condenseOperandsAnd(final Collection<? extends Formula> operands) {
    final LinkedHashSet<Formula> ops = new LinkedHashSet<>();
    this.cnfCheck = true;
    for (final Formula form : operands)
      if (form.type() == AND) {
        for (final Formula f : ((NAryOperator) form).operands) {
          this.addFormulaAnd(ops, f);
          if (!this.formulaAdditionResult[0])
            return null;
          if (!this.formulaAdditionResult[1])
            this.cnfCheck = false;
        }
      } else {
        this.addFormulaAnd(ops, form);
        if (!this.formulaAdditionResult[0])
          return null;
        if (!this.formulaAdditionResult[1])
          this.cnfCheck = false;
      }
    return ops;
  }
683333
public static void writeTo(Output output, int number, boolean repeated, Enum<?> e) 
    throws IOException
    {
        if(ENUMS_BY_NAME)
            output.writeString(number, e.name(), repeated);
        else
            output.writeEnum(number, e.ordinal(), repeated);
    }