Class RiverObjectInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.io.DataInput, java.io.ObjectInput, java.io.ObjectStreamConstants, java.lang.AutoCloseable, ByteInput

    public class RiverObjectInputStream
    extends MarshallerObjectInputStream
    • Constructor Detail

      • RiverObjectInputStream

        protected RiverObjectInputStream​(RiverUnmarshaller riverUnmarshaller,
                                         BlockUnmarshaller delegateUnmarshaller)
                                  throws java.io.IOException,
                                         java.lang.SecurityException
        Throws:
        java.io.IOException
        java.lang.SecurityException
    • Method Detail

      • getAndSet

        private int getAndSet​(int set)
      • discardReadObject

        void discardReadObject()
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • registerValidation

        public void registerValidation​(java.io.ObjectInputValidation obj,
                                       int prio)
                                throws java.io.NotActiveException,
                                       java.io.InvalidObjectException
        Description copied from class: MarshallerObjectInputStream
        Specified by:
        registerValidation in class MarshallerObjectInputStream
        Throws:
        java.io.NotActiveException
        java.io.InvalidObjectException
      • swapCurrent

        protected java.lang.Object swapCurrent​(java.lang.Object obj)
      • start

        protected int start()
      • finish

        protected void finish​(int restoreState)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • checkState

        private void checkState()
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • read

        public int read()
                 throws java.io.IOException
        Description copied from class: MarshallerObjectInputStream
        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 MarshallerObjectInputStream
        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
        Description copied from class: MarshallerObjectInputStream
        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 MarshallerObjectInputStream
        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
        Description copied from class: MarshallerObjectInputStream
        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 MarshallerObjectInputStream
        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
      • skip

        public long skip​(long n)
                  throws java.io.IOException
        Description copied from class: MarshallerObjectInputStream
        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 MarshallerObjectInputStream
        Parameters:
        n - the number of bytes to attempt to skip
        Returns:
        the number of bytes skipped
        Throws:
        java.io.IOException - if an error occurs
      • fullReset

        protected void fullReset()
      • noCustomData

        protected void noCustomData()
      • getRestoreIdx

        protected int getRestoreIdx()