Class MarshallerObjectInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.io.DataInput, java.io.ObjectInput, java.io.ObjectStreamConstants, java.lang.AutoCloseable, ByteInput
    Direct Known Subclasses:
    RiverObjectInputStream, SerializingCloner.StepObjectInputStream, SerialObjectInputStream

    public abstract class MarshallerObjectInputStream
    extends java.io.ObjectInputStream
    implements ByteInput
    A marshaller's object input stream. Used by marshallers for compatibility with Java serialization. Instances of this class may be passed in to the overridden serialization methods for a class implementing Serializable.

    This class is not part of the marshalling API; rather it is intended for marshaller implementers to make it easier to develop Java serialization-compatible marshallers.

    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.io.ObjectInputStream

        java.io.ObjectInputStream.GetField
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Unmarshaller input  
      • 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 Detail

      • MarshallerObjectInputStream

        protected MarshallerObjectInputStream​(Unmarshaller input)
                                       throws java.io.IOException,
                                              java.lang.SecurityException
        Construct a new instance which delegates to the given unmarshaller.
        Parameters:
        input - the delegate unmarshaller
        Throws:
        java.io.IOException - if an I/O error occurs
        java.lang.SecurityException - if the caller does not have permission to construct an instance of this class
    • Method Detail

      • readObjectOverride

        protected java.lang.Object readObjectOverride()
                                               throws java.io.IOException,
                                                      java.lang.ClassNotFoundException
        Overrides:
        readObjectOverride in class java.io.ObjectInputStream
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • readUnshared

        public java.lang.Object readUnshared()
                                      throws java.io.IOException,
                                             java.lang.ClassNotFoundException
        Overrides:
        readUnshared in class java.io.ObjectInputStream
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • read

        public int read()
                 throws java.io.IOException
        Reads the next byte of data from the input stream. If no byte is available because the end of the stream has been reached, the value -1 is returned. This method blocks until input data is available, the end of the stream is detected, or an exception is thrown.
        Specified by:
        read in interface ByteInput
        Specified by:
        read in interface java.io.ObjectInput
        Overrides:
        read in class java.io.ObjectInputStream
        Returns:
        the next byte, or -1 if the end of stream has been reached
        Throws:
        java.io.IOException - if an error occurs
      • read

        public int read​(byte[] buf)
                 throws java.io.IOException
        Read some bytes from the input stream into the given array. Returns the number of bytes actually read (possibly zero), or -1 if the end of stream has been reached.
        Specified by:
        read in interface ByteInput
        Specified by:
        read in interface java.io.ObjectInput
        Overrides:
        read in class java.io.InputStream
        Parameters:
        buf - the destination array
        Returns:
        the number of bytes read (possibly zero), or -1 if the end of stream has been reached
        Throws:
        java.io.IOException - if an error occurs
      • read

        public int read​(byte[] buf,
                        int off,
                        int len)
                 throws java.io.IOException
        Read some bytes from the input stream into the given array. Returns the number of bytes actually read (possibly zero), or -1 if the end of stream has been reached.
        Specified by:
        read in interface ByteInput
        Specified by:
        read in interface java.io.ObjectInput
        Overrides:
        read in class java.io.ObjectInputStream
        Parameters:
        buf - the destination array
        off - the offset into the array into which data should be read
        len - the number of bytes to attempt to fill in the destination array
        Returns:
        the number of bytes read (possibly zero), or -1 if the end of stream has been reached
        Throws:
        java.io.IOException - if an error occurs
      • available

        public int available()
                      throws java.io.IOException
        Returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking by the next invocation of a method for this input stream.
        Specified by:
        available in interface ByteInput
        Specified by:
        available in interface java.io.ObjectInput
        Overrides:
        available in class java.io.ObjectInputStream
        Returns:
        the number of bytes
        Throws:
        java.io.IOException - if an error occurs
      • readBoolean

        public boolean readBoolean()
                            throws java.io.IOException
        Specified by:
        readBoolean in interface java.io.DataInput
        Overrides:
        readBoolean in class java.io.ObjectInputStream
        Throws:
        java.io.IOException
      • readByte

        public byte readByte()
                      throws java.io.IOException
        Specified by:
        readByte in interface java.io.DataInput
        Overrides:
        readByte in class java.io.ObjectInputStream
        Throws:
        java.io.IOException
      • readUnsignedByte

        public int readUnsignedByte()
                             throws java.io.IOException
        Specified by:
        readUnsignedByte in interface java.io.DataInput
        Overrides:
        readUnsignedByte in class java.io.ObjectInputStream
        Throws:
        java.io.IOException
      • readChar

        public char readChar()
                      throws java.io.IOException
        Specified by:
        readChar in interface java.io.DataInput
        Overrides:
        readChar in class java.io.ObjectInputStream
        Throws:
        java.io.IOException
      • readShort

        public short readShort()
                        throws java.io.IOException
        Specified by:
        readShort in interface java.io.DataInput
        Overrides:
        readShort in class java.io.ObjectInputStream
        Throws:
        java.io.IOException
      • readUnsignedShort

        public int readUnsignedShort()
                              throws java.io.IOException
        Specified by:
        readUnsignedShort in interface java.io.DataInput
        Overrides:
        readUnsignedShort in class java.io.ObjectInputStream
        Throws:
        java.io.IOException
      • readInt

        public int readInt()
                    throws java.io.IOException
        Specified by:
        readInt in interface java.io.DataInput
        Overrides:
        readInt in class java.io.ObjectInputStream
        Throws:
        java.io.IOException
      • readLong

        public long readLong()
                      throws java.io.IOException
        Specified by:
        readLong in interface java.io.DataInput
        Overrides:
        readLong in class java.io.ObjectInputStream
        Throws:
        java.io.IOException
      • readFloat

        public float readFloat()
                        throws java.io.IOException
        Specified by:
        readFloat in interface java.io.DataInput
        Overrides:
        readFloat in class java.io.ObjectInputStream
        Throws:
        java.io.IOException
      • readDouble

        public double readDouble()
                          throws java.io.IOException
        Specified by:
        readDouble in interface java.io.DataInput
        Overrides:
        readDouble in class java.io.ObjectInputStream
        Throws:
        java.io.IOException
      • readFully

        public void readFully​(byte[] buf)
                       throws java.io.IOException
        Specified by:
        readFully in interface java.io.DataInput
        Overrides:
        readFully in class java.io.ObjectInputStream
        Throws:
        java.io.IOException
      • readFully

        public void readFully​(byte[] buf,
                              int off,
                              int len)
                       throws java.io.IOException
        Specified by:
        readFully in interface java.io.DataInput
        Overrides:
        readFully in class java.io.ObjectInputStream
        Throws:
        java.io.IOException
      • skipBytes

        public int skipBytes​(int len)
                      throws java.io.IOException
        Specified by:
        skipBytes in interface java.io.DataInput
        Overrides:
        skipBytes in class java.io.ObjectInputStream
        Throws:
        java.io.IOException
      • readLine

        @Deprecated
        public java.lang.String readLine()
                                  throws java.io.IOException
        Deprecated.
        Specified by:
        readLine in interface java.io.DataInput
        Overrides:
        readLine in class java.io.ObjectInputStream
        Throws:
        java.io.IOException
      • readUTF

        public java.lang.String readUTF()
                                 throws java.io.IOException
        Specified by:
        readUTF in interface java.io.DataInput
        Overrides:
        readUTF in class java.io.ObjectInputStream
        Throws:
        java.io.IOException
      • skip

        public long skip​(long n)
                  throws java.io.IOException
        Skips over and discards up to n bytes of data from this input stream. If the end of stream is reached, this method returns 0 in order to be consistent with InputStream.skip(long).
        Specified by:
        skip in interface ByteInput
        Specified by:
        skip in interface java.io.ObjectInput
        Overrides:
        skip in class java.io.InputStream
        Parameters:
        n - the number of bytes to attempt to skip
        Returns:
        the number of bytes skipped
        Throws:
        java.io.IOException - if an error occurs
      • mark

        public final void mark​(int readlimit)
        Overrides:
        mark in class java.io.InputStream
      • reset

        public final void reset()
                         throws java.io.IOException
        Overrides:
        reset in class java.io.InputStream
        Throws:
        java.io.IOException
      • markSupported

        public final boolean markSupported()
        Overrides:
        markSupported in class java.io.InputStream
      • close

        public final void close()
                         throws java.lang.IllegalStateException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface java.io.ObjectInput
        Overrides:
        close in class java.io.ObjectInputStream
        Throws:
        java.lang.IllegalStateException
      • resolveClass

        protected final java.lang.Class<?> resolveClass​(java.io.ObjectStreamClass desc)
                                                 throws java.lang.IllegalStateException
        Overrides:
        resolveClass in class java.io.ObjectInputStream
        Throws:
        java.lang.IllegalStateException
      • resolveProxyClass

        protected final java.lang.Class<?> resolveProxyClass​(java.lang.String[] interfaces)
                                                      throws java.lang.IllegalStateException
        Overrides:
        resolveProxyClass in class java.io.ObjectInputStream
        Throws:
        java.lang.IllegalStateException
      • resolveObject

        protected final java.lang.Object resolveObject​(java.lang.Object obj)
                                                throws java.lang.IllegalStateException
        Overrides:
        resolveObject in class java.io.ObjectInputStream
        Throws:
        java.lang.IllegalStateException
      • enableResolveObject

        protected final boolean enableResolveObject​(boolean enable)
                                             throws java.lang.IllegalStateException
        Overrides:
        enableResolveObject in class java.io.ObjectInputStream
        Throws:
        java.lang.IllegalStateException
      • readStreamHeader

        protected final void readStreamHeader()
                                       throws java.lang.IllegalStateException
        Overrides:
        readStreamHeader in class java.io.ObjectInputStream
        Throws:
        java.lang.IllegalStateException
      • readClassDescriptor

        protected final java.io.ObjectStreamClass readClassDescriptor()
                                                               throws java.lang.IllegalStateException
        Overrides:
        readClassDescriptor in class java.io.ObjectInputStream
        Throws:
        java.lang.IllegalStateException
      • defaultReadObject

        public abstract void defaultReadObject()
                                        throws java.io.IOException,
                                               java.lang.ClassNotFoundException
        Overrides:
        defaultReadObject in class java.io.ObjectInputStream
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • readFields

        public abstract java.io.ObjectInputStream.GetField readFields()
                                                               throws java.io.IOException,
                                                                      java.lang.ClassNotFoundException
        Overrides:
        readFields in class java.io.ObjectInputStream
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • registerValidation

        public abstract void registerValidation​(java.io.ObjectInputValidation obj,
                                                int prio)
                                         throws java.io.NotActiveException,
                                                java.io.InvalidObjectException
        Overrides:
        registerValidation in class java.io.ObjectInputStream
        Throws:
        java.io.NotActiveException
        java.io.InvalidObjectException