Esempio n. 1
0
        /*
         * Customized deserialization.
         */
        private void readObject(java.io.ObjectInputStream inJ)//throws IOException,            ClassNotFoundException {
        {
            inJ.defaultReadObject();
            byte major = inJ.readByte();
            byte minor = inJ.readByte();

            // only check MAJOR version
            if (major != MAJOR)
            {
                // logging.5=Different version - {0}.{1}
                throw new java.io.IOException("Different version - " + //$NON-NLS-1$
                                              java.lang.Byte.valueOf(major) + "." + java.lang.Byte.valueOf(minor));
            }

            int length = inJ.readInt();

            if (length >= 0)
            {
                parameters = new Object[length];
                for (int i = 0; i < parameters.Length; i++)
                {
                    parameters[i] = inJ.readObject();
                }
            }
            if (null != resourceBundleName)
            {
                try {
                    resourceBundle = Logger.loadResourceBundle(resourceBundleName);
                } catch (MissingResourceException e) {
                    // Cannot find the specified resource bundle
                    resourceBundle = null;
                }
            }
        }
Esempio n. 2
0
        private void readObject(java.io.ObjectInputStream stream)
        {//throws IOException, ClassNotFoundException {
            stream.defaultReadObject();

            systemList = (java.util.ArrayList <T>)stream.readObject();
            userList   = (java.util.ArrayList <T>)stream.readObject();
        }
Esempio n. 3
0
 private void readObject(java.io.ObjectInputStream ois)  //throws IOException,
 //ClassNotFoundException {
 {
     ois.defaultReadObject();
     this.isLengthActual    = false;
     this.actualArrayLength = bits.Length;
     this.needClearJ        = this.getActualArrayLength() != 0;
 }
Esempio n. 4
0
 /*
  * For old versions of QName which didn't have a prefix field,
  * &lt;code&gt;ObjectInputStream.defaultReadObject()&lt;/code&gt; will initialize
  * the prefix to &lt;code&gt;null&lt;/code&gt; instead of the empty string. This
  * method fixes up the prefix field if it didn't exist in the serialized
  * object.
  */
 private void readObject(java.io.ObjectInputStream inJ)
 {//throws IOException, ClassNotFoundException {
     inJ.defaultReadObject();
     if (prefix == null)
     {
         prefix = XMLConstants.DEFAULT_NS_PREFIX;
     }
 }
 private void readObject(java.io.ObjectInputStream inJ)
 {//throws IOException, ClassNotFoundException {
     inJ.defaultReadObject();
     maps[0] = new java.util.TreeMap <Object, Object>(comparatorJ);
     maps[1] = new java.util.TreeMap <Object, Object>(comparatorJ);
     java.util.Map <Object, Object> map = (java.util.Map <Object, Object>)inJ.readObject();
     putAll(map);
 }
Esempio n. 6
0
        /*
         * Reads the state of a {@code StringBuilder} from the passed stream and
         * restores it to this instance.
         *
         * @param in
         *            the stream to read the state from.
         * @throws IOException
         *             if the stream throws it during the read.
         * @throws ClassNotFoundException
         *             if the stream throws it during the read.
         */
        private void readObject(java.io.ObjectInputStream inJ)  //throws IOException,
        //ClassNotFoundException {
        {
            inJ.defaultReadObject();
            int count = inJ.readInt();

            char[] value = (char[])inJ.readObject();
            set(value, count);
        }
        /**
         * Deserializes the data held in this object to the stream specified.
         * <p>
         * The first java.io.Serializable subclass must call this method from
         * <code>readObject</code>.
         */
        protected virtual void doReadObject(java.io.ObjectInputStream inputStream)
        {//throws IOException, ClassNotFoundException {
            init();
            int size = inputStream.readInt();

            for (int i = 0; i < size; i++)
            {
                add(inputStream.readObject());
            }
        }
Esempio n. 8
0
 /**
  * Serialization helper to setup transient resource bundle instance.
  *
  * @param in
  *            the input stream to read the instance data from.
  * @throws IOException
  *             if an IO error occurs.
  * @throws ClassNotFoundException
  *             if a class is not found.
  */
 private void readObject(java.io.ObjectInputStream inJ)//throws IOException,            ClassNotFoundException {
 {
     inJ.defaultReadObject();
     if (resourceBundleName != null)
     {
         try {
             rb = ResourceBundle.getBundle(resourceBundleName);
         } catch (MissingResourceException) {
             rb = null;
         }
     }
 }
        /**
         * Read the buffer in using a custom routine.
         *
         * @param in  the input stream
         * @throws IOException
         * @throws ClassNotFoundException
         */
        private void readObject(java.io.ObjectInputStream inJ)
        {//throws IOException, ClassNotFoundException {
            inJ.defaultReadObject();
            int size = inJ.readInt();

            buffer = new Object[size + 1];
            for (int i = 0; i < size; i++)
            {
                buffer[i] = inJ.readObject();
            }
            head = 0;
            tail = size;
        }
        /**
         * Read the map in using a custom routine.
         * @param map  the map to use
         * @param in  the input stream
         * @throws IOException
         * @throws ClassNotFoundException
         */
        protected virtual void doReadObject(java.util.Map <Object, Object> map, java.io.ObjectInputStream inJ)
        {// throws IOException, ClassNotFoundException {
            this.map = map;
            int entrySize = inJ.readInt();

            for (int i = 0; i < entrySize; i++)
            {
                Object obj   = inJ.readObject();
                int    count = inJ.readInt();
                map.put(obj, new MutableInteger(count));
                sizeJ += count;
            }
        }
Esempio n. 11
0
            /**
             * Creates an object using serialization.
             *
             * @return the new object
             */
            public Object create()
            {
                java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream(512);
                java.io.ByteArrayInputStream  bais = null;
                try
                {
                    java.io.ObjectOutputStream outJ = new java.io.ObjectOutputStream(baos);
                    outJ.writeObject(iPrototype);

                    bais = new java.io.ByteArrayInputStream(baos.toByteArray());
                    java.io.ObjectInputStream inJ = new java.io.ObjectInputStream(bais);
                    return(inJ.readObject());
                }
                catch (java.lang.ClassNotFoundException ex)
                {
                    throw new FunctorException(ex);
                }
                catch (java.io.IOException ex)
                {
                    throw new FunctorException(ex);
                }
                finally
                {
                    try
                    {
                        if (bais != null)
                        {
                            bais.close();
                        }
                    }
                    catch (java.io.IOException ex)
                    {
                        // ignore
                    }
                    try
                    {
                        if (baos != null)
                        {
                            baos.close();
                        }
                    }
                    catch (java.io.IOException ex)
                    {
                        // ignore
                    }
                }
            }
Esempio n. 12
0
 private void readObject(java.io.ObjectInputStream stream)
 {//throws IOException,ClassNotFoundException
     {
         stream.defaultReadObject();
         TreeMap <E, Object> map = new TreeMap <E, Object>(
             (Comparator <E>)stream.readObject());
         int size = stream.readInt();
         if (size > 0)
         {
             TreeMap <E, Object> .Node <E, Object> lastNode = null;
             for (int i = 0; i < size; i++)
             {
                 E elem = (E)stream.readObject();
                 lastNode = map.addToLast(lastNode, elem, java.lang.Boolean.TRUE);
             }
         }
         backingMap = map;
     }
 }
Esempio n. 13
0
        private void readObject(java.io.ObjectInputStream ois)                          //throws IOException,
        {                                                                               //ClassNotFoundException {
            ois.defaultReadObject();
            this.globalListeners = new java.util.LinkedList <PropertyChangeListener>(); //!+ Basties note: Why is above the init with ArrayList but here LinkedList???
            if (null == this.children)
            {
                this.children = new java.util.Hashtable <String, PropertyChangeSupport>();
            }
            Object listener = null;

            do
            {
                // Reads a listener _or_ proxy
                listener = ois.readObject();
                if (listener != null)
                {
                    addPropertyChangeListener((PropertyChangeListener)listener);
                }
            } while (listener != null);
        }
Esempio n. 14
0
        /**
         * Read the buffer in using a custom routine.
         *
         * @param in  the input stream
         * @throws IOException
         * @throws ClassNotFoundException
         */
        private void readObject(java.io.ObjectInputStream inJ)
        {//throws IOException, ClassNotFoundException {
            inJ.defaultReadObject();
            elements = new Object[maxElements];
            int size = inJ.readInt();

            for (int i = 0; i < size; i++)
            {
                elements[i] = inJ.readObject();
            }
            start = 0;
            full  = (size == maxElements);
            if (full)
            {
                end = 0;
            }
            else
            {
                end = size;
            }
        }
Esempio n. 15
0
        /**
         * Replaces the superclassm method to read the state of this class.
         * <p>
         * Serialization is not one of the JDK's nicest topics. Normal serialization will
         * initialise the superclass before the subclass. Sometimes however, this isn't
         * what you want, as in this case the <code>put()</code> method on read can be
         * affected by subclass state.
         * <p>
         * The solution adopted here is to deserialize the state data of this class in
         * this protected method. This method must be called by the
         * <code>readObject()</code> of the first java.io.Serializable subclass.
         * <p>
         * Subclasses may override if the subclass has a specific field that must be present
         * before <code>put()</code> or <code>calculateThreshold()</code> will work correctly.
         *
         * @param in  the input stream
         */
        protected void doreadObject(java.io.ObjectInputStream inJ)
        {//throws IOException, ClassNotFoundException {
            this.keyType     = inJ.readInt();
            this.valueType   = inJ.readInt();
            this.purgeValues = inJ.readBoolean();
            this.loadFactor  = inJ.readFloat();
            int capacity = inJ.readInt();

            init();
            data = new HashEntry[capacity];
            while (true)
            {
                Object key = inJ.readObject();
                if (key == null)
                {
                    break;
                }
                Object value = inJ.readObject();
                put(key, value);
            }
            threshold = calculateThreshold(data.Length, loadFactor);
            // do not call base.doReadObject() as code there doesn't work for reference map
        }
Esempio n. 16
0
 /**
  * Checks name after default deserialization.
  */
 private void readObject(java.io.ObjectInputStream inJ) // throws IOException,
 {                                                      //ClassNotFoundException {
     inJ.defaultReadObject();
     checkName(this.getName());
 }
Esempio n. 17
0
 /**
  * Read the bag in using a custom routine.
  */
 private void readObject(java.io.ObjectInputStream inJ)
 {//throws IOException, ClassNotFoundException {
     inJ.defaultReadObject();
     base.doReadObject(new java.util.HashMap <Object, Object>(), inJ);
 }
 /**
  * Read the map in using a custom routine.
  */
 private void readObject(java.io.ObjectInputStream inJ)
 {//throws IOException, ClassNotFoundException {
     inJ.defaultReadObject();
     doReadObject(inJ);
 }
Esempio n. 19
0
 /**
  * Read AffineTransform object from the input stream
  * @param stream - the input steam
  * @throws IOException - if there are I/O errors while reading from the input strem
  * @throws ClassNotFoundException - if class could not be found
  */
 private void readObject(java.io.ObjectInputStream stream)
 {//throws IOException, ClassNotFoundException {
     stream.defaultReadObject();
     type = TYPE_UNKNOWN;
 }
Esempio n. 20
0
 /**
  * Read the map in using a custom routine.
  *
  * @param in  the input stream
  * @throws IOException
  * @throws ClassNotFoundException
  * @since Commons Collections 3.1
  */
 private void readObject(java.io.ObjectInputStream inJ)
 {// throws IOException, ClassNotFoundException {
     inJ.defaultReadObject();
     map = (java.util.Map <Object, Object>)inJ.readObject();
 }
 /**
  * Read the bag in using a custom routine.
  */
 private void readObject(java.io.ObjectInputStream inJ)
 {//throws IOException, ClassNotFoundException {
     inJ.defaultReadObject();
     java.util.Comparator <Object> comp = (java.util.Comparator <Object>)inJ.readObject();
     base.doReadObject(new java.util.TreeMap <Object, Object>(comp), inJ);
 }
 /**
  * Reads the data necessary for <code>put()</code> to work in the superclass.
  */
 protected virtual void doreadObject(java.io.ObjectInputStream inJ)
 {//throws IOException, ClassNotFoundException {
     maxSizeJ = inJ.readInt();
     base.doReadObject(inJ);
 }
Esempio n. 23
0
 /*
  * This method always throws a {@code NotSerializableException}, because
  * this object cannot be serialized,
  */
 private void readObject(java.io.ObjectInputStream inJ)
 {//throws IOException,
     //ClassNotFoundException {
     throw new java.io.NotSerializableException();
 }
            /**
             * Creates an object using serialization.
             *
             * @return the new object
             */
            public Object create()
            {
                java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream(512);
                java.io.ByteArrayInputStream bais = null;
                try
                {
                    java.io.ObjectOutputStream outJ = new java.io.ObjectOutputStream(baos);
                    outJ.writeObject(iPrototype);

                    bais = new java.io.ByteArrayInputStream(baos.toByteArray());
                    java.io.ObjectInputStream inJ = new java.io.ObjectInputStream(bais);
                    return inJ.readObject();

                }
                catch (java.lang.ClassNotFoundException ex)
                {
                    throw new FunctorException(ex);
                }
                catch (java.io.IOException ex)
                {
                    throw new FunctorException(ex);
                }
                finally
                {
                    try
                    {
                        if (bais != null)
                        {
                            bais.close();
                        }
                    }
                    catch (java.io.IOException ex)
                    {
                        // ignore
                    }
                    try
                    {
                        if (baos != null)
                        {
                            baos.close();
                        }
                    }
                    catch (java.io.IOException ex)
                    {
                        // ignore
                    }
                }
            }