Java tutorial
//package com.java2s; /************************************************************************** * Licensed Material - Property of Dawn InfoTek * * Copyright (c) Dawn InfoTek Inc. 1999, 2004, 2008 -All rights reserved. * * (<http://www.dawninfotek.com>) * * * * This file contains proprietary intellectual property of * * Dawn InfoTek Inc. The contents of and information in this file * * is only to be used in conjunction with a valid Dawn4J license * * as specified in the Dawn4J license agreement. All other use * * is prohibited. * **************************************************************************/ import java.io.BufferedWriter; import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter; public class Main { /** * * @param os * @param request * @param charsetName * @throws IOException */ public static final void writeString(OutputStream os, String request, String charsetName) throws IOException { OutputStreamWriter writer = new OutputStreamWriter(os, charsetName); BufferedWriter bw = new BufferedWriter(writer); bw.write(request); bw.write("\r\n"); bw.flush(); } }