Here you can find the source of writeString(OutputStream os, String text)
public static void writeString(OutputStream os, String text) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.*; public class Main { public static void writeString(OutputStream os, String text) throws IOException { BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(os, "UTF-8")); writer.write(text);/*w w w. ja v a 2s.co m*/ writer.flush(); writer.close(); } }