Java DataOutputStream Write String writeString(String s, DataOutputStream out)

Here you can find the source of writeString(String s, DataOutputStream out)

Description

write String

License

Apache License

Declaration

public static void writeString(String s, DataOutputStream out) throws IOException 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.io.*;

public class Main {

    public static void writeString(String s, DataOutputStream out) throws IOException {
        out.writeInt(s.length());//from ww w . j  av a 2 s .  c om
        for (char c : s.toCharArray()) {
            out.writeChar(c);
        }
    }
}

Related

  1. writeString(DataOutputStream output, String s)
  2. writeString(DataOutputStream outputStream, String string)
  3. writeString(final DataOutputStream out, final String str)
  4. writeString(final DataOutputStream out, final String value)
  5. writeString(String arg, DataOutputStream data)
  6. writeString(String s, DataOutputStream out)
  7. writeString(String s, DataOutputStream writer)
  8. writeString(String str, DataOutputStream dos)
  9. writeString(String str, DataOutputStream os)