Java OutputStream Write String writeString(OutputStream output, String string)

Here you can find the source of writeString(OutputStream output, String string)

Description

write String

License

Open Source License

Declaration

public static void writeString(OutputStream output, String string) throws IOException 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2010 Freescale Semiconductor.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * /*from   ww w .ja  v a 2  s .c o  m*/
 * Contributors:
 *     Serge Beauchamp (Freescale Semiconductor) - initial API and implementation
 *******************************************************************************/

import java.io.IOException;

import java.io.OutputStream;

public class Main {
    public static void writeString(OutputStream output, String string) throws IOException {
        // if changed, don't forget to update calculateStringOutput()
        output.write(("<" + Integer.toString(string.length()) + ">").getBytes());
        output.write(("<" + string + ">").getBytes());
    }
}

Related

  1. writeString(OutputStream out, String s)
  2. writeString(OutputStream out, String s)
  3. writeString(OutputStream out, String str)
  4. writeString(OutputStream out, String str)
  5. WriteString(OutputStream output, String string)
  6. writeString(String data, int length, OutputStream out)
  7. writeString(String s, OutputStream out)
  8. writeString(String str, ObjectOutputStream dos)
  9. writeString(String value, OutputStream os)