Here you can find the source of writeString(String string, ObjectOutput out)
public static void writeString(String string, ObjectOutput out) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.io.ObjectOutput; public class Main { public static final int NULL = 0x00; public static final int NOTNULL = 0x01; public static void writeString(String string, ObjectOutput out) throws IOException { if (string == null) { out.writeByte(NULL);//from w w w.j ava2s .c o m } else { out.writeByte(NOTNULL); out.writeUTF(string); } } public static void writeByte(Byte num, ObjectOutput out) throws IOException { if (num == null) { out.writeByte(NULL); } else { out.writeByte(NOTNULL); out.writeByte(num); } } }