Class Ser

  • All Implemented Interfaces:
    java.io.Externalizable, java.io.Serializable

    final class Ser
    extends java.lang.Object
    implements java.io.Externalizable
    A package scoped class used to manage serialization efficiently.

    This class is mutable and intended for use by a single thread.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) static byte BIG_MONEY
      Type for BigMoney.
      (package private) static byte CURRENCY_UNIT
      Type for CurrencyUnit.
      (package private) static byte MONEY
      Type for Money.
      private java.lang.Object object
      The data object.
      private byte type
      The type.
    • Constructor Summary

      Constructors 
      Constructor Description
      Ser()
      Constructor for serialization.
      Ser​(byte type, java.lang.Object object)
      Constructor for package.
    • Field Detail

      • type

        private byte type
        The type.
      • object

        private java.lang.Object object
        The data object.
    • Constructor Detail

      • Ser

        public Ser()
        Constructor for serialization.
      • Ser

        Ser​(byte type,
            java.lang.Object object)
        Constructor for package.
        Parameters:
        type - the type
        object - the object
    • Method Detail

      • writeExternal

        public void writeExternal​(java.io.ObjectOutput out)
                           throws java.io.IOException
        Outputs the data.
        Specified by:
        writeExternal in interface java.io.Externalizable
        Parameters:
        out - the output stream
        Throws:
        java.io.IOException - if an error occurs
      • writeBigMoney

        private void writeBigMoney​(java.io.ObjectOutput out,
                                   BigMoney obj)
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • writeCurrency

        private void writeCurrency​(java.io.ObjectOutput out,
                                   CurrencyUnit obj)
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • readExternal

        public void readExternal​(java.io.ObjectInput in)
                          throws java.io.IOException,
                                 java.lang.ClassNotFoundException
        Outputs the data.
        Specified by:
        readExternal in interface java.io.Externalizable
        Parameters:
        in - the input stream
        Throws:
        java.io.IOException - if an error occurs
        java.lang.ClassNotFoundException
      • readBigMoney

        private BigMoney readBigMoney​(java.io.ObjectInput in)
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • readCurrency

        private CurrencyUnit readCurrency​(java.io.ObjectInput in)
                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • readResolve

        private java.lang.Object readResolve()
        Returns the object that will replace this one.
        Returns:
        the read object, should never be null