Class RefusingObjectOutputStream
java.lang.Object
java.io.OutputStream
java.io.ObjectOutputStream
de.aristaflow.adept2.util.injection.RefusingObjectOutputStream
- All Implemented Interfaces:
Closeable,DataOutput,Flushable,ObjectOutput,ObjectStreamConstants,AutoCloseable
An
ObjectOutputStream refusing InjectionAware objects, the mirror of
RefusingObjectInputStream on the write side. It is the first guarantee moved earlier
rather than a second one: anything a plain helper writes is read by a plain helper, so the
refusal would have come regardless – at the consumer, possibly a persistence round-trip
later, and with the stack trace of the consumer instead of the one of the producer. Where nothing
reads the bytes back in this process, a persisted file or a digest, the write side is the only
side there is.
The refusal happens where the graph that travels becomes visible, that is after a
writeReplace and for every object actually written, so it is graph-deep as well.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.io.ObjectOutputStream
ObjectOutputStream.PutField -
Field Summary
Fields inherited from interface java.io.ObjectStreamConstants
baseWireHandle, PROTOCOL_VERSION_1, PROTOCOL_VERSION_2, SC_BLOCK_DATA, SC_ENUM, SC_EXTERNALIZABLE, SC_SERIALIZABLE, SC_WRITE_METHOD, SERIAL_FILTER_PERMISSION, STREAM_MAGIC, STREAM_VERSION, SUBCLASS_IMPLEMENTATION_PERMISSION, SUBSTITUTION_PERMISSION, TC_ARRAY, TC_BASE, TC_BLOCKDATA, TC_BLOCKDATALONG, TC_CLASS, TC_CLASSDESC, TC_ENDBLOCKDATA, TC_ENUM, TC_EXCEPTION, TC_LONGSTRING, TC_MAX, TC_NULL, TC_OBJECT, TC_PROXYCLASSDESC, TC_REFERENCE, TC_RESET, TC_STRING -
Constructor Summary
ConstructorsConstructorDescriptionCreates a refusing stream writing to the designated output stream. -
Method Summary
Methods inherited from class java.io.ObjectOutputStream
annotateClass, annotateProxyClass, close, defaultWriteObject, drain, enableReplaceObject, flush, putFields, reset, useProtocolVersion, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeClassDescriptor, writeDouble, writeFields, writeFloat, writeInt, writeLong, writeObject, writeObjectOverride, writeShort, writeStreamHeader, writeUnshared, writeUTFMethods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
RefusingObjectOutputStream
Creates a refusing stream writing to the designated output stream.- Parameters:
out- The output stream to write the objects to.- Throws:
IOException- If the header cannot be written to the designated output stream, anIOExceptionwill be thrown.
-
-
Method Details
-
replaceObject
- Overrides:
replaceObjectin classObjectOutputStream- Throws:
IOException
-