Java DataOutput Write String writeString(String s, DataOutput output)

Here you can find the source of writeString(String s, DataOutput output)

Description

Write a String to a DataOutput.

License

Open Source License

Parameter

Parameter Description
s a parameter
output a parameter

Exception

Parameter Description
IOException an exception

Declaration

public static void writeString(String s, DataOutput output) throws IOException 

Method Source Code


//package com.java2s;

import java.io.DataOutput;
import java.io.IOException;

public class Main {
    /**/*from   ww  w  .  ja v a 2 s. c  om*/
     * Write a String to a DataOutput.
     * @param s
     * @param output
     * @throws IOException
     */
    public static void writeString(String s, DataOutput output) throws IOException {
        output.writeInt(s.length());
        output.writeChars(s);
    }
}

Related

  1. writeString(DataOutput out, String v)
  2. writeString(DataOutput output, String s)
  3. writeString(final String data, final DataOutput out, final int length)
  4. writeString(final String string, final DataOutput out)
  5. writeString(String par0Str, DataOutput par1DataOutput)
  6. writeString(String s, DataOutput stream)
  7. writeString(String s, DataOutput stream)