Class SerialMarshaller

    • Field Detail

      • instanceCache

        private final IdentityIntMap<java.lang.Object> instanceCache
      • descriptorCache

        private final IdentityIntMap<java.lang.Class<?>> descriptorCache
      • replacementCache

        private final java.util.IdentityHashMap<java.lang.Object,​java.lang.Object> replacementCache
      • externalizers

        private final java.util.IdentityHashMap<java.lang.Class<?>,​Externalizer> externalizers
      • bufferSize

        private final int bufferSize
      • instanceSeq

        private int instanceSeq
      • createObjectOutputStreamAction

        private final java.security.PrivilegedExceptionAction<SerialObjectOutputStream> createObjectOutputStreamAction
      • primitives

        private static final IdentityIntMap<java.lang.Class<?>> primitives
    • Method Detail

      • doWriteObject

        protected void doWriteObject​(java.lang.Object orig,
                                     boolean unshared)
                              throws java.io.IOException
        Description copied from class: AbstractObjectOutput
        Implementation of the actual object-writing method.
        Specified by:
        doWriteObject in class AbstractObjectOutput
        Parameters:
        orig - the object to write
        unshared - true if the instance is unshared, false if it is shared
        Throws:
        java.io.IOException - if an I/O error occurs
      • writeSerialData

        private void writeSerialData​(java.lang.Class<?> objClass,
                                     java.lang.Object obj)
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • createObjectOutputStream

        private SerialObjectOutputStream createObjectOutputStream()
                                                           throws java.io.IOException
        Throws:
        java.io.IOException
      • getObjectOutputStream

        private SerialObjectOutputStream getObjectOutputStream()
                                                        throws java.io.IOException
        Throws:
        java.io.IOException
      • doWriteFields

        protected void doWriteFields​(SerializableClass info,
                                     java.lang.Object obj)
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • writeClassDescFor

        private void writeClassDescFor​(java.lang.Class<?> forClass)
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • writeNewClassDescFor

        private void writeNewClassDescFor​(java.lang.Class<?> forClass)
                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • writeNewProxyClassDesc

        private void writeNewProxyClassDesc​(java.lang.Class<?> forClass)
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • writeNewPlainClassDesc

        private void writeNewPlainClassDesc​(java.lang.Class<?> forClass)
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • doEndBlock

        private void doEndBlock()
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • getSignature

        private static java.lang.String getSignature​(java.lang.Class<?> type)
      • clearInstanceCache

        public void clearInstanceCache()
                                throws java.io.IOException
        Description copied from interface: Marshaller
        Discard the instance cache. May also discard the class cache in implementations that do not support separated class and instance caches.
        Specified by:
        clearInstanceCache in interface Marshaller
        Throws:
        java.io.IOException - if an error occurs
      • clearClassCache

        public void clearClassCache()
                             throws java.io.IOException
        Description copied from interface: Marshaller
        Discard the class cache. Implicitly also discards the instance cache.
        Specified by:
        clearClassCache in interface Marshaller
        Throws:
        java.io.IOException - if an error occurs
      • start

        public void start​(ByteOutput byteOutput)
                   throws java.io.IOException
        Description copied from class: AbstractMarshaller
        Begin writing to a stream.
        Specified by:
        start in interface Marshaller
        Overrides:
        start in class AbstractMarshaller
        Parameters:
        byteOutput - the new stream
        Throws:
        java.io.IOException - if an error occurs
      • flush

        public void flush()
                   throws java.io.IOException
        Description copied from class: SimpleDataOutput
        Specified by:
        flush in interface java.io.Flushable
        Specified by:
        flush in interface java.io.ObjectOutput
        Overrides:
        flush in class SimpleDataOutput
        Throws:
        java.io.IOException
      • writeNoBlockFlush

        void writeNoBlockFlush​(byte[] bytes,
                               int off,
                               int len)
                        throws java.io.IOException
        Throws:
        java.io.IOException