public void writeFields() throws IOException { CustomPutField customPutField = (CustomPutField) customFields.pop(); peekCallback().writeFieldsToStream(customPutField.asMap()); }
public PutField putFields() { CustomPutField result = new CustomPutField(); customFields.push(result); return result; }
/*** Methods to delegate to callback ***/ public void defaultWriteObject() throws IOException { peekCallback().defaultWriteObject(); }
public void write(ObjectOutput out) throws IOException { peekCallback().writeToStream(asMap()); }
public GetField readFields() throws IOException { return new CustomGetField(peekCallback().readFieldsFromStream()); }
private Object readResolve() { return new ClassLoaderReference(new CompositeClassLoader()); }
protected void writeObjectOverride(Object obj) throws IOException { peekCallback().writeToStream(obj); }
public void flush() throws IOException { peekCallback().flush(); }
public void registerValidation(ObjectInputValidation validation, int priority) throws NotActiveException, InvalidObjectException { peekCallback().registerValidation(validation, priority); }
public void close() throws IOException { peekCallback().close(); }
public void defaultReadObject() throws IOException { peekCallback().defaultReadObject(); }
/** * Warning, this object is expensive to create (due to functionality inherited from superclass). * Use the static fetch() method instead, wherever possible. * * @see #getInstance(com.thoughtworks.xstream.converters.DataHolder, com.thoughtworks.xstream.core.util.CustomObjectOutputStream.StreamCallback) */ public CustomObjectOutputStream(StreamCallback callback) throws IOException, SecurityException { this.callbacks.push(callback); }
public void setReference(ClassLoader reference) { this.reference = reference instanceof com.thoughtworks.xstream.core.util.ClassLoaderReference ? ((com.thoughtworks.xstream.core.util.ClassLoaderReference)reference) .getReference() : reference; }
/** * Creates an AbstractReader with a provided {@link NameCoder}. * * @param nameCoder the name coder used to read names from the incoming format * @since 1.4 */ protected AbstractReader(NameCoder nameCoder) { this.nameCoder = (NameCoder)Cloneables.cloneIfPossible(nameCoder); }
/** * Resolves an object as native serialization does by calling readResolve(), if available. * * @deprecated As of 1.4.8, moved into internal util package. */ public Object callReadResolve(Object result) { return serializationMembers.callReadResolve(result); }
/** * @deprecated As of 1.4.8, moved into internal util package. */ public Object callWriteReplace(Object object) { return serializationMembers.callWriteReplace(object); }
public void write(byte[] buf) throws IOException { peekCallback().writeToStream(buf); }
/** * Allows the CustomObjectOutputStream (which is expensive to create) to be reused. */ public void pushCallback(StreamCallback callback) { this.callbacks.push(callback); }
public void writeBoolean(boolean val) throws IOException { peekCallback().writeToStream(val ? Boolean.TRUE : Boolean.FALSE); // JDK 1.3 friendly }