Write data to the output stream with the specified formatting.

@param outputStream The output stream.
@param data The data to write.
@param terminate If true, add a line terminator.
@param level The indent level.
773592
protected void write(OutputStream outputStream, String data, boolean terminate, int level) {
        try {
            if (data != null) {
                if (level > 0) {
                    outputStream.write(StringUtils.repeat("  ", level).getBytes(CS_UTF8));
                }
                
                outputStream.write(data.getBytes(CS_UTF8));
                
                if (terminate) {
                    outputStream.write("\n".getBytes());
                }
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
600468
public void write(DataOutput out) throws IOException {
        WritableUtils.writeVInt(out, length);
        out.write(bytes, 0, length);
    }
183980
public static void write(final CharSequence data, final File file) throws IOException {
		Validate.notNull(file);
		Validate.notNull(data);

		try (BufferedWriter writer = Files.newBufferedWriter(file.toPath(), Charsets.UTF_8)) {
			writer.append(data);
		}
	}
1089650
public void write(String logService, LogLevel level, String msg, Throwable t)
	{
		doWrite(logService, level, msg, t);
	}
713512
public void write(DataOutput out) throws IOException {
    out.writeLong(version);
    Text.writeString(out, dir);
    out.writeLong(gen);
  }
591254
public void writeEnd(final OutputStream result) throws IOException{
        if(this.fontStyle != UNDEFINED) {
            if((fontStyle & STYLE_BOLD) == STYLE_BOLD) {
                result.write(FONT_BOLD);
                result.write(intToByteArray(0));
            }
            if((fontStyle & STYLE_ITALIC) == STYLE_ITALIC) {
                result.write(FONT_ITALIC);
                result.write(intToByteArray(0));
            }
            if((fontStyle & STYLE_UNDERLINE) == STYLE_UNDERLINE) {
                result.write(FONT_UNDERLINE);
                result.write(intToByteArray(0));
            }
            if((fontStyle & STYLE_STRIKETHROUGH) == STYLE_STRIKETHROUGH) {
                result.write(FONT_STRIKETHROUGH);
                result.write(intToByteArray(0));
            }
            if((fontStyle & STYLE_HIDDEN) == STYLE_HIDDEN) {
                result.write(FONT_HIDDEN);
                result.write(intToByteArray(0));
            }
            if((fontStyle & STYLE_DOUBLE_STRIKETHROUGH) == STYLE_DOUBLE_STRIKETHROUGH) {
                result.write(FONT_DOUBLE_STRIKETHROUGH);
                result.write(intToByteArray(0));
            }
            if((fontStyle & STYLE_SHADOW) == STYLE_SHADOW) {
                result.write(FONT_SHADOW);
                result.write(intToByteArray(0));
            }
            if((fontStyle & STYLE_OUTLINE) == STYLE_OUTLINE) {
                result.write(FONT_OUTLINE);
                result.write(intToByteArray(0));
            }
            if((fontStyle & STYLE_EMBOSSED) == STYLE_EMBOSSED) {
                result.write(FONT_EMBOSSED);
                result.write(intToByteArray(0));
            }
            if((fontStyle & STYLE_ENGRAVED) == STYLE_ENGRAVED) {
                result.write(FONT_ENGRAVED);
                result.write(intToByteArray(0));
            }
        }
    }
443499
public void writeTo(final OutputStream out) throws IOException
	{
		if(out == null) throw new NullPointerException();
		
		final int n = arrays.size();
		for(int k = 0; k < n; k++) {
			byte[] src = (byte[])arrays.get(k);
			out.write(src);
		}
		if(pos > 0) out.write(buffer, 0, pos);
	}
1222061
public <T> void write(final OutputStream stream, final T object,
			final DataTypeDescriptor<T> descriptor, final boolean indent) throws IOException {
		if (stream == null) throw new NullPointerException("out");
		if (descriptor == null) throw new NullPointerException("descriptor");

		JsonGenerator generator = factory.createGenerator(stream);
		if (indent) {
			generator.useDefaultPrettyPrinter();
		}

		write(object, descriptor, generator);
		generator.flush();
	}
1091362
public void dump(YamlNode data, OutputStream output) {
        getDelegate().dump(data, new OutputStreamWriter(output, Charset
                                                        .forName("UTF-8")));
    }
893279
public void writeToExcel(List<? extends Object> datas, boolean hasTitle,
                             OutputStream outputStream, boolean transverse) throws IOException {
        writeToExcel(datas, hasTitle, outputStream, IN_MEMORY, transverse);
    }
853664
@Override
  public void write(DataOutput out) throws IOException {
    Text.writeString(out, filename);
    Text.writeString(out, jobid);
    out.writeBoolean(isJobConfFile);
    out.writeBoolean(isJobHistoryFile);
  }
1152055
public static void writeList(Collection<?> lines,
                                 OutputStream output) throws IOException {
        writeList(lines, output, Charset.defaultCharset());
    }
1259934
protected void write(BufferedWriter out, String type, byte[] data) throws IOException
    {
        writeHeader(out, type);
        out.write(this.base64.encode(data, 64));
        out.newLine();
        writeFooter(out, type);
    }
1345107
public void write(String logService, LogLevel level, String msg)
	{
		doFileWrite(logService, level, msg, null);
	}
602494
public void write(DataOutput out) throws IOException {
    UTF8.writeString(out, file);
    out.writeLong(start);
    out.writeLong(length);
  }
465464
protected void writeByteArray(ObjectOutput output, byte[] data) throws IOException {
        if (null == data || 0 == data.length) {
            output.writeInt(-1);
        } else {
            output.writeInt(data.length);
            output.write(data);
        }
    }
861763
public function output($string, $outputLevel = self::OUTPUT_LEVEL_1, $stream = 'output')
    {
        if ($outputLevel <= $this->defaultOutputLevel) {
            fputs($this->getStream($stream), $string);
        }
    }