Java DataOutputStream Write String writeString(String arg, DataOutputStream data)

Here you can find the source of writeString(String arg, DataOutputStream data)

Description

write String

License

Apache License

Declaration

public static void writeString(String arg, DataOutputStream data) throws IOException 

Method Source Code

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

import java.io.DataOutputStream;
import java.io.IOException;

public class Main {
    public static void writeString(String arg, DataOutputStream data) throws IOException {
        byte[] abyte = arg.getBytes();

        data.writeInt(abyte.length);/*from  w  w  w  .j  a va 2 s .  c  om*/
        for (byte curr : abyte)
            data.writeByte(curr);
    }
}

Related

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