Here you can find the source of writeString(OutputStream out, String s)
public static void writeString(OutputStream out, String s) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.io.OutputStream; public class Main { public static void writeString(OutputStream out, String s) throws IOException { byte[] b = s.getBytes(); out.write(b, 0, b.length);//from ww w.jav a 2s . com } }