Here you can find the source of deserializeString(DataInputStream din)
public static String deserializeString(DataInputStream din) throws IOException
//package com.java2s; import java.io.*; public class Main { private static String tagNull = "Null"; private static String tagString = "String"; public static String deserializeString(DataInputStream din) throws IOException { String str;/* w w w. j a v a 2s. c o m*/ if (deserializeHeaderString(tagString, din)) str = din.readUTF(); else str = null; deserializeTrailerString(tagString, din); return str; } private static boolean deserializeHeaderString(String str, DataInputStream din) throws IOException { String s2 = din.readUTF(); if (s2.equals("[" + tagNull)) return false; if (!s2.equals("[" + str)) throw new IOException("bogus serialization header"); return true; } private static void deserializeTrailerString(String str, DataInputStream din) throws IOException { String s2 = din.readUTF(); // if ( ! s2.equals( str + "]" ) ) // throw new IOException( "bogus serialization trailer" ); if (!s2.equals("]")) throw new IOException("bogus serialization trailer"); } }