Here you can find the source of writeStream(byte[] data, OutputStream os)
public static void writeStream(byte[] data, OutputStream os) throws IOException
//package com.java2s; //License from project: Apache License import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter; public class Main { public static void writeStream(byte[] data, OutputStream os) throws IOException { os.write(data);/*ww w .j ava 2 s . c o m*/ os.flush(); } public static void writeStream(String data, OutputStream os) throws IOException { OutputStreamWriter fw = new OutputStreamWriter(os); fw.write(data); fw.flush(); } }