/** * Shrink string over the wire, should be used for constant number of strings which are * repetitive (i.e space names, class names) */ public static void writeRepetitiveString(ObjectOutput out, String s) throws IOException { if (out instanceof MarshalOutputStream) ((MarshalOutputStream) out).writeRepetitiveObject(s); else writeString(out, s); }
/** * Should only be used for objects that their class is known to SystemJars.DATA_GRID_JAR, * meaning at SystemJars.DATA_GRID_JAR, its dependencies or JDK 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 void writeRepetitiveObject(ObjectOutput out, Object obj) throws IOException { if (out instanceof MarshalOutputStream) ((MarshalOutputStream) out).writeRepetitiveObject(obj); else writeObject(out, obj); }