public RiverObjectOutputStream run() throws IOException { return new RiverObjectOutputStream(getBlockMarshaller(), RiverMarshaller.this); } };
protected void doWriteSerializableObject(final SerializableClass info, final Object obj, final Class<?> objClass) throws IOException { final Class<?> superclass = objClass.getSuperclass(); if (superclass != null && serializabilityChecker.isSerializable(superclass)) { doWriteSerializableObject(registry.lookup(superclass), obj, superclass); } if (info.hasWriteObject()) { final RiverObjectOutputStream objectOutputStream = getObjectOutputStream(); final SerializableClass oldInfo = objectOutputStream.swapClass(info); final Object oldObj = objectOutputStream.swapCurrent(obj); final int restoreState = objectOutputStream.start(); boolean ok = false; try { info.callWriteObject(obj, objectOutputStream); objectOutputStream.finish(restoreState); writeEndBlock(); objectOutputStream.swapCurrent(oldObj); objectOutputStream.swapClass(oldInfo); ok = true; } finally { if (! ok) { objectOutputStream.fullReset(); } } } else { doWriteFields(info, obj); } }
public void writeChar(final int val) throws IOException { checkState(); super.writeChar(val); }
public void defaultWriteObject() throws IOException { if (! compareAndSetState(UNWRITTEN_FIELDS, ON)) { throw new NotActiveException("writeFields() may only be called when the fields have not yet been written"); } try { marshaller.doWriteFields(serializableClass, current); } finally { putField = null; serializableClass = null; current = null; } }
protected int start() throws IOException { return getAndSetState(UNWRITTEN_FIELDS); }
public void writeFields() throws IOException { final RiverPutField putField = this.putField; if (putField == null) { throw new NotActiveException("no current PutField object"); } if (! compareAndSetState(UNWRITTEN_FIELDS, ON)) { throw new NotActiveException("writeFields() may only be called when the fields have not yet been written"); } this.putField = null; putField.write(marshaller); }
protected int start() throws IOException { return getAndSetState(UNWRITTEN_FIELDS); }
protected void doWriteSerializableObject(final SerializableClass info, final Object obj, final Class<?> objClass) throws IOException { final Class<?> superclass = objClass.getSuperclass(); if (Serializable.class.isAssignableFrom(superclass)) { doWriteSerializableObject(registry.lookup(superclass), obj, superclass); } if (info.hasWriteObject()) { final RiverObjectOutputStream objectOutputStream = getObjectOutputStream(); final SerializableClass oldInfo = objectOutputStream.swapClass(info); final Object oldObj = objectOutputStream.swapCurrent(obj); final RiverObjectOutputStream.State restoreState = objectOutputStream.start(); boolean ok = false; try { info.callWriteObject(obj, objectOutputStream); writeEndBlock(); objectOutputStream.finish(restoreState); objectOutputStream.swapCurrent(oldObj); objectOutputStream.swapClass(oldInfo); ok = true; } finally { if (! ok) { objectOutputStream.fullReset(); } } } else { doWriteFields(info, obj); } }
public void write(final byte[] buf) throws IOException { checkState(); super.write(buf); }
public void defaultWriteObject() throws IOException { if (! compareAndSetState(UNWRITTEN_FIELDS, ON)) { throw new NotActiveException("writeFields() may only be called when the fields have not yet been written"); } try { marshaller.doWriteFields(serializableClass, current); } finally { putField = null; serializableClass = null; current = null; } }
public RiverObjectOutputStream run() throws IOException { return new RiverObjectOutputStream(getBlockMarshaller(), RiverMarshaller.this); } };
protected int start() throws IOException { return getAndSetState(UNWRITTEN_FIELDS); }
protected void doWriteSerializableObject(final SerializableClass info, final Object obj, final Class<?> objClass) throws IOException { final Class<?> superclass = objClass.getSuperclass(); if (superclass != null && serializabilityChecker.isSerializable(superclass)) { doWriteSerializableObject(registry.lookup(superclass), obj, superclass); } if (info.hasWriteObject()) { final RiverObjectOutputStream objectOutputStream = getObjectOutputStream(); final SerializableClass oldInfo = objectOutputStream.swapClass(info); final Object oldObj = objectOutputStream.swapCurrent(obj); final int restoreState = objectOutputStream.start(); boolean ok = false; try { info.callWriteObject(obj, objectOutputStream); objectOutputStream.finish(restoreState); writeEndBlock(); objectOutputStream.swapCurrent(oldObj); objectOutputStream.swapClass(oldInfo); ok = true; } finally { if (! ok) { objectOutputStream.fullReset(); } } } else { doWriteFields(info, obj); } }
public void writeBytes(final String str) throws IOException { checkState(); super.writeBytes(str); }
public void defaultWriteObject() throws IOException { if (! compareAndSetState(UNWRITTEN_FIELDS, ON)) { throw new NotActiveException("writeFields() may only be called when the fields have not yet been written"); } try { marshaller.doWriteFields(serializableClass, current); } finally { putField = null; serializableClass = null; current = null; } }
public RiverObjectOutputStream run() throws IOException { return new RiverObjectOutputStream(getBlockMarshaller(), RiverMarshaller.this); } };
protected int start() throws IOException { return getAndSetState(UNWRITTEN_FIELDS); }
protected void doWriteSerializableObject(final SerializableClass info, final Object obj, final Class<?> objClass) throws IOException { final Class<?> superclass = objClass.getSuperclass(); if (superclass != null && serializabilityChecker.isSerializable(superclass)) { doWriteSerializableObject(registry.lookup(superclass), obj, superclass); } if (info.hasWriteObject()) { final RiverObjectOutputStream objectOutputStream = getObjectOutputStream(); final SerializableClass oldInfo = objectOutputStream.swapClass(info); final Object oldObj = objectOutputStream.swapCurrent(obj); final int restoreState = objectOutputStream.start(); boolean ok = false; try { info.callWriteObject(obj, objectOutputStream); objectOutputStream.finish(restoreState); writeEndBlock(); objectOutputStream.swapCurrent(oldObj); objectOutputStream.swapClass(oldInfo); ok = true; } finally { if (! ok) { objectOutputStream.fullReset(); } } } else { doWriteFields(info, obj); } }
public void writeUTF(final String str) throws IOException { checkState(); super.writeUTF(str); }
public void defaultWriteObject() throws IOException { if (! compareAndSetState(UNWRITTEN_FIELDS, ON)) { throw new NotActiveException("writeFields() may only be called when the fields have not yet been written"); } try { marshaller.doWriteFields(serializableClass, current); } finally { putField = null; serializableClass = null; current = null; } }