Java OutputStream Write String writeString(OutputStream os, String request, String charsetName)

Here you can find the source of writeString(OutputStream os, String request, String charsetName)

Description

write String

License

Open Source License

Parameter

Parameter Description
os a parameter
request a parameter
charsetName a parameter

Exception

Parameter Description
IOException an exception

Declaration

public static final void writeString(OutputStream os, String request, String charsetName) throws IOException 

Method Source Code

//package com.java2s;
/**************************************************************************
 * 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 {
    /**/*w  ww.j a va 2  s.c  o m*/
     * 
     * @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();
    }
}

Related

  1. writeString(ByteArrayOutputStream baos, String s)
  2. writeString(final OutputStream output, final String s)
  3. writeString(ObjectOutputStream stream, String string)
  4. writeString(OutputStream os, String s)
  5. writeString(OutputStream os, String s)
  6. writeString(OutputStream os, String s)
  7. writeString(OutputStream os, String str)