/** Writes an object using the specified serializer. The registered serializer is ignored. */ public void writeObject (Output output, Object object, Serializer serializer) { if (output == null) throw new IllegalArgumentException("output cannot be null."); if (object == null) throw new IllegalArgumentException("object cannot be null."); if (serializer == null) throw new IllegalArgumentException("serializer cannot be null."); beginObject(); try { if (references && writeReferenceOrNull(output, object, false)) { serializer.setGenerics(this, null); return; } if (TRACE || (DEBUG && depth == 1)) log("Write", object); serializer.write(this, output, object); } finally { if (--depth == 0 && autoReset) reset(); } }
/** Writes an object using the specified serializer. The registered serializer is ignored. */ public void writeObject (Output output, Object object, Serializer serializer) { if (output == null) throw new IllegalArgumentException("output cannot be null."); if (object == null) throw new IllegalArgumentException("object cannot be null."); if (serializer == null) throw new IllegalArgumentException("serializer cannot be null."); beginObject(); try { if (references && writeReferenceOrNull(output, object, false)) { serializer.setGenerics(this, null); return; } if (TRACE || (DEBUG && depth == 1)) log("Write", object); serializer.write(this, output, object); } finally { if (--depth == 0 && autoReset) reset(); } }
/** Writes an object using the specified serializer. The registered serializer is ignored. */ public void writeObject (Output output, Object object, Serializer serializer) { if (output == null) throw new IllegalArgumentException("output cannot be null."); if (object == null) throw new IllegalArgumentException("object cannot be null."); if (serializer == null) throw new IllegalArgumentException("serializer cannot be null."); beginObject(); try { if (references && writeReferenceOrNull(output, object, false)) { serializer.setGenerics(this, null); return; } if (TRACE || (DEBUG && depth == 1)) log("Write", object); serializer.write(this, output, object); } finally { if (--depth == 0 && autoReset) reset(); } }
/** Writes an object using the specified serializer. The registered serializer is ignored. */ public void writeObject (Output output, Object object, Serializer serializer) { if (output == null) throw new IllegalArgumentException("output cannot be null."); if (object == null) throw new IllegalArgumentException("object cannot be null."); if (serializer == null) throw new IllegalArgumentException("serializer cannot be null."); beginObject(); try { if (references && writeReferenceOrNull(output, object, false)) { serializer.setGenerics(this, null); return; } if (TRACE || (DEBUG && depth == 1)) log("Write", object); serializer.write(this, output, object); } finally { if (--depth == 0 && autoReset) reset(); } }
/** Reads an object using the specified serializer. The registered serializer is ignored. */ public <T> T readObject (Input input, Class<T> type, Serializer serializer) { if (input == null) throw new IllegalArgumentException("input cannot be null."); if (type == null) throw new IllegalArgumentException("type cannot be null."); if (serializer == null) throw new IllegalArgumentException("serializer cannot be null."); beginObject(); try { T object; if (references) { int stackSize = readReferenceOrNull(input, type, false); if (stackSize == REF) return (T)readObject; object = (T)serializer.read(this, input, type); if (stackSize == readReferenceIds.size) reference(object); } else object = (T)serializer.read(this, input, type); if (TRACE || (DEBUG && depth == 1)) log("Read", object); return object; } finally { if (--depth == 0 && autoReset) reset(); } }
/** Reads an object using the specified serializer. The registered serializer is ignored. */ public <T> T readObject (Input input, Class<T> type, Serializer serializer) { if (input == null) throw new IllegalArgumentException("input cannot be null."); if (type == null) throw new IllegalArgumentException("type cannot be null."); if (serializer == null) throw new IllegalArgumentException("serializer cannot be null."); beginObject(); try { T object; if (references) { int stackSize = readReferenceOrNull(input, type, false); if (stackSize == REF) return (T)readObject; object = (T)serializer.read(this, input, type); if (stackSize == readReferenceIds.size) reference(object); } else object = (T)serializer.read(this, input, type); if (TRACE || (DEBUG && depth == 1)) log("Read", object); return object; } finally { if (--depth == 0 && autoReset) reset(); } }
/** Reads an object using the specified serializer. The registered serializer is ignored. */ public <T> T readObject (Input input, Class<T> type, Serializer serializer) { if (input == null) throw new IllegalArgumentException("input cannot be null."); if (type == null) throw new IllegalArgumentException("type cannot be null."); if (serializer == null) throw new IllegalArgumentException("serializer cannot be null."); beginObject(); try { T object; if (references) { int stackSize = readReferenceOrNull(input, type, false); if (stackSize == REF) return (T)readObject; object = (T)serializer.read(this, input, type); if (stackSize == readReferenceIds.size) reference(object); } else object = (T)serializer.read(this, input, type); if (TRACE || (DEBUG && depth == 1)) log("Read", object); return object; } finally { if (--depth == 0 && autoReset) reset(); } }
/** Writes an object using the registered serializer. */ public void writeObject (Output output, Object object) { if (output == null) throw new IllegalArgumentException("output cannot be null."); if (object == null) throw new IllegalArgumentException("object cannot be null."); beginObject(); try { if (references && writeReferenceOrNull(output, object, false)) { getRegistration(object.getClass()).getSerializer().setGenerics(this, null); return; } if (TRACE || (DEBUG && depth == 1)) log("Write", object); getRegistration(object.getClass()).getSerializer().write(this, output, object); } finally { if (--depth == 0 && autoReset) reset(); } }
/** Writes an object using the registered serializer. */ public void writeObject (Output output, Object object) { if (output == null) throw new IllegalArgumentException("output cannot be null."); if (object == null) throw new IllegalArgumentException("object cannot be null."); beginObject(); try { if (references && writeReferenceOrNull(output, object, false)) { getRegistration(object.getClass()).getSerializer().setGenerics(this, null); return; } if (TRACE || (DEBUG && depth == 1)) log("Write", object); getRegistration(object.getClass()).getSerializer().write(this, output, object); } finally { if (--depth == 0 && autoReset) reset(); } }
/** Writes an object using the registered serializer. */ public void writeObject (Output output, Object object) { if (output == null) throw new IllegalArgumentException("output cannot be null."); if (object == null) throw new IllegalArgumentException("object cannot be null."); beginObject(); try { if (references && writeReferenceOrNull(output, object, false)) { getRegistration(object.getClass()).getSerializer().setGenerics(this, null); return; } if (TRACE || (DEBUG && depth == 1)) log("Write", object); getRegistration(object.getClass()).getSerializer().write(this, output, object); } finally { if (--depth == 0 && autoReset) reset(); } }
/** Writes an object using the registered serializer. */ public void writeObject (Output output, Object object) { if (output == null) throw new IllegalArgumentException("output cannot be null."); if (object == null) throw new IllegalArgumentException("object cannot be null."); beginObject(); try { if (references && writeReferenceOrNull(output, object, false)) { getRegistration(object.getClass()).getSerializer().setGenerics(this, null); return; } if (TRACE || (DEBUG && depth == 1)) log("Write", object); getRegistration(object.getClass()).getSerializer().write(this, output, object); } finally { if (--depth == 0 && autoReset) reset(); } }
/** Writes the class and object or null using the registered serializer. * @param object May be null. */ public void writeClassAndObject (Output output, Object object) { if (output == null) throw new IllegalArgumentException("output cannot be null."); beginObject(); try { if (object == null) { writeClass(output, null); return; } Registration registration = writeClass(output, object.getClass()); if (references && writeReferenceOrNull(output, object, false)) { registration.getSerializer().setGenerics(this, null); return; } if (TRACE || (DEBUG && depth == 1)) log("Write", object); registration.getSerializer().write(this, output, object); } finally { if (--depth == 0 && autoReset) reset(); } }
/** Writes the class and object or null using the registered serializer. * @param object May be null. */ public void writeClassAndObject (Output output, Object object) { if (output == null) throw new IllegalArgumentException("output cannot be null."); beginObject(); try { if (object == null) { writeClass(output, null); return; } Registration registration = writeClass(output, object.getClass()); if (references && writeReferenceOrNull(output, object, false)) { registration.getSerializer().setGenerics(this, null); return; } if (TRACE || (DEBUG && depth == 1)) log("Write", object); registration.getSerializer().write(this, output, object); } finally { if (--depth == 0 && autoReset) reset(); } }
/** Writes the class and object or null using the registered serializer. * @param object May be null. */ public void writeClassAndObject (Output output, Object object) { if (output == null) throw new IllegalArgumentException("output cannot be null."); beginObject(); try { if (object == null) { writeClass(output, null); return; } Registration registration = writeClass(output, object.getClass()); if (references && writeReferenceOrNull(output, object, false)) { registration.getSerializer().setGenerics(this, null); return; } if (TRACE || (DEBUG && depth == 1)) log("Write", object); registration.getSerializer().write(this, output, object); } finally { if (--depth == 0 && autoReset) reset(); } }
/** Reads an object using the registered serializer. */ public <T> T readObject (Input input, Class<T> type) { if (input == null) throw new IllegalArgumentException("input cannot be null."); if (type == null) throw new IllegalArgumentException("type cannot be null."); beginObject(); try { T object; if (references) { int stackSize = readReferenceOrNull(input, type, false); if (stackSize == REF) return (T)readObject; object = (T)getRegistration(type).getSerializer().read(this, input, type); if (stackSize == readReferenceIds.size) reference(object); } else object = (T)getRegistration(type).getSerializer().read(this, input, type); if (TRACE || (DEBUG && depth == 1)) log("Read", object); return object; } finally { if (--depth == 0 && autoReset) reset(); } }
/** Reads an object using the registered serializer. */ public <T> T readObject (Input input, Class<T> type) { if (input == null) throw new IllegalArgumentException("input cannot be null."); if (type == null) throw new IllegalArgumentException("type cannot be null."); beginObject(); try { T object; if (references) { int stackSize = readReferenceOrNull(input, type, false); if (stackSize == REF) return (T)readObject; object = (T)getRegistration(type).getSerializer().read(this, input, type); if (stackSize == readReferenceIds.size) reference(object); } else object = (T)getRegistration(type).getSerializer().read(this, input, type); if (TRACE || (DEBUG && depth == 1)) log("Read", object); return object; } finally { if (--depth == 0 && autoReset) reset(); } }
/** Reads an object using the registered serializer. */ public <T> T readObject (Input input, Class<T> type) { if (input == null) throw new IllegalArgumentException("input cannot be null."); if (type == null) throw new IllegalArgumentException("type cannot be null."); beginObject(); try { T object; if (references) { int stackSize = readReferenceOrNull(input, type, false); if (stackSize == REF) return (T)readObject; object = (T)getRegistration(type).getSerializer().read(this, input, type); if (stackSize == readReferenceIds.size) reference(object); } else object = (T)getRegistration(type).getSerializer().read(this, input, type); if (TRACE || (DEBUG && depth == 1)) log("Read", object); return object; } finally { if (--depth == 0 && autoReset) reset(); } }
/** Reads an object using the registered serializer. */ public <T> T readObject (Input input, Class<T> type) { if (input == null) throw new IllegalArgumentException("input cannot be null."); if (type == null) throw new IllegalArgumentException("type cannot be null."); beginObject(); try { T object; if (references) { int stackSize = readReferenceOrNull(input, type, false); if (stackSize == REF) return (T)readObject; object = (T)getRegistration(type).getSerializer().read(this, input, type); if (stackSize == readReferenceIds.size) reference(object); } else object = (T)getRegistration(type).getSerializer().read(this, input, type); if (TRACE || (DEBUG && depth == 1)) log("Read", object); return object; } finally { if (--depth == 0 && autoReset) reset(); } }
/** Reads the class and object or null using the registered serializer. * @return May be null. */ public Object readClassAndObject (Input input) { if (input == null) throw new IllegalArgumentException("input cannot be null."); beginObject(); try { Registration registration = readClass(input); if (registration == null) return null; Class type = registration.getType(); Object object; if (references) { registration.getSerializer().setGenerics(this, null); int stackSize = readReferenceOrNull(input, type, false); if (stackSize == REF) return readObject; object = registration.getSerializer().read(this, input, type); if (stackSize == readReferenceIds.size) reference(object); } else object = registration.getSerializer().read(this, input, type); if (TRACE || (DEBUG && depth == 1)) log("Read", object); return object; } finally { if (--depth == 0 && autoReset) reset(); } }
/** Reads the class and object or null using the registered serializer. * @return May be null. */ public Object readClassAndObject (Input input) { if (input == null) throw new IllegalArgumentException("input cannot be null."); beginObject(); try { Registration registration = readClass(input); if (registration == null) return null; Class type = registration.getType(); Object object; if (references) { registration.getSerializer().setGenerics(this, null); int stackSize = readReferenceOrNull(input, type, false); if (stackSize == REF) return readObject; object = registration.getSerializer().read(this, input, type); if (stackSize == readReferenceIds.size) reference(object); } else object = registration.getSerializer().read(this, input, type); if (TRACE || (DEBUG && depth == 1)) log("Read", object); return object; } finally { if (--depth == 0 && autoReset) reset(); } }