/** * Read strings that were Shrinked using {@link #writeRepetitiveString(ObjectOutput, String)} */ public static String readRepetitiveString(ObjectInput in) throws IOException, ClassNotFoundException { if (in instanceof MarshalInputStream) return (String) ((MarshalInputStream) in).readRepetitiveObject(); return readString(in); }
/** * Objects read and written with repetitive must be immutable (cannot be changed as they are * kept in underlying map, changing them will affect the next repetitiveRead/Write */ public static <T> T readRepetitiveObject(ObjectInput in) throws IOException, ClassNotFoundException { if (in instanceof MarshalInputStream) return (T) ((MarshalInputStream) in).readRepetitiveObject(); return (T) readObject(in); }