private static void writeStringToOutput(String str,DataOutput out) throws IOException {
  out.writeInt(str.length());
  out.writeChars(str);
}

private static void writeStringToOutput ( String str , DataOutput out ) throws IOException { out . writeInt ( str . length ( ) ) ; out . writeChars ( str ) ; }
write the given string to the given data output ( replacement for writeutf )
