Here you can find the source of WriteStringToOutputStream(String data, OutputStream os)
private static void WriteStringToOutputStream(String data, OutputStream os) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.io.OutputStream; public class Main { private static void WriteStringToOutputStream(String data, OutputStream os) throws IOException { for (Character c : data.toCharArray()) { os.write((int) c.charValue()); }// w ww . j a va 2 s.co m } }