Java tutorial
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.io.OutputStream; public class Main { public static void writeStringToOutputStream(OutputStream out, String str) throws IOException { out.write(str.getBytes("UTF-8")); } }