Java DataOutputStream Write String writeString(DataOutputStream outputStream, String string)

Here you can find the source of writeString(DataOutputStream outputStream, String string)

Description

write String

License

Open Source License

Declaration

static public void writeString(DataOutputStream outputStream, String string) throws IOException 

Method Source Code


//package com.java2s;
/*/*from   ww  w  . j  a  va 2s .c  o m*/
 * Copyright 2014.
 * Distributed under the terms of the GPLv3 License.
 *
 * Authors:
 *      Clemens Zeidler <czei002@aucklanduni.ac.nz>
 */

import java.io.*;

public class Main {
    static public void writeString(DataOutputStream outputStream, String string) throws IOException {
        outputStream.writeInt(string.getBytes().length);
        outputStream.write(string.getBytes());
    }
}

Related

  1. writeString(DataOutputStream out, String str)
  2. writeString(DataOutputStream out, String text)
  3. writeString(DataOutputStream out, String theString)
  4. writeString(DataOutputStream out, String val)
  5. writeString(DataOutputStream output, String s)
  6. writeString(final DataOutputStream out, final String str)
  7. writeString(final DataOutputStream out, final String value)
  8. writeString(String arg, DataOutputStream data)
  9. writeString(String s, DataOutputStream out)