Here you can find the source of writeString(String s, DataOutput output)
Parameter | Description |
---|---|
s | a parameter |
output | a parameter |
Parameter | Description |
---|---|
IOException | an exception |
public static void writeString(String s, DataOutput output) throws IOException
//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); } }