Exemple #1
0
        /// <summary>
        /// Writes default serializable fields to stream.  Writes
        /// a list of serializable <code>ItemListeners</code>
        /// as optional data.  The non-serializable
        /// <code>ItemListeners</code> are detected and
        /// no attempt is made to serialize them.
        /// </summary>
        /// <param name="s"> the <code>ObjectOutputStream</code> to write
        /// @serialData <code>null</code> terminated sequence of
        ///  0 or more pairs; the pair consists of a <code>String</code>
        ///  and an <code>Object</code>; the <code>String</code> indicates
        ///  the type of object and is one of the following:
        ///  <code>itemListenerK</code> indicating an
        ///    <code>ItemListener</code> object
        /// </param>
        /// <seealso cref= AWTEventMulticaster#save(ObjectOutputStream, String, EventListener) </seealso>
        /// <seealso cref= java.awt.Component#itemListenerK </seealso>
        /// <seealso cref= #readObject(ObjectInputStream) </seealso>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException
        private void WriteObject(ObjectOutputStream s)
        {
            s.DefaultWriteObject();

            AWTEventMulticaster.Save(s, ItemListenerK, ItemListener);
            s.WriteObject(null);
        }
Exemple #2
0
        /// <summary>
        /// Writes default serializable fields to stream.
        /// </summary>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException
        private void WriteObject(ObjectOutputStream s)
        {
            // 4352819: We only need this degenerate writeObject to make
            // it safe for future versions of this class to write optional
            // data to the stream.
            s.DefaultWriteObject();
        }
        /// <exception cref="System.IO.IOException"/>
        private void WriteObject(ObjectOutputStream stream)
        {
            //    log.info("\nBefore compression:");
            //    log.info("arg size: " + argCounter.size() + "  total: " + argCounter.totalCount());
            //    log.info("stop size: " + stopCounter.size() + "  total: " + stopCounter.totalCount());
            ClassicCounter <IntDependency> fullArgCounter = argCounter;

            argCounter = new ClassicCounter <IntDependency>();
            foreach (IntDependency dependency in fullArgCounter.KeySet())
            {
                if (dependency.head != wildTW && dependency.arg != wildTW && dependency.head.word != -1 && dependency.arg.word != -1)
                {
                    argCounter.IncrementCount(dependency, fullArgCounter.GetCount(dependency));
                }
            }
            ClassicCounter <IntDependency> fullStopCounter = stopCounter;

            stopCounter = new ClassicCounter <IntDependency>();
            foreach (IntDependency dependency_1 in fullStopCounter.KeySet())
            {
                if (dependency_1.head.word != -1)
                {
                    stopCounter.IncrementCount(dependency_1, fullStopCounter.GetCount(dependency_1));
                }
            }
            //    log.info("After compression:");
            //    log.info("arg size: " + argCounter.size() + "  total: " + argCounter.totalCount());
            //    log.info("stop size: " + stopCounter.size() + "  total: " + stopCounter.totalCount());
            stream.DefaultWriteObject();
            argCounter  = fullArgCounter;
            stopCounter = fullStopCounter;
        }
Exemple #4
0
        /// <summary>
        /// @serialData Default fields, followed by a two byte version number
        /// (major byte, followed by minor byte), followed by information on
        /// the log record parameter array.  If there is no parameter array,
        /// then -1 is written.  If there is a parameter array (possible of zero
        /// length) then the array length is written as an integer, followed
        /// by String values for each parameter.  If a parameter is null, then
        /// a null String is written.  Otherwise the output of Object.toString()
        /// is written.
        /// </summary>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: private void writeObject(ObjectOutputStream out) throws IOException
        private void WriteObject(ObjectOutputStream @out)
        {
            // We have to call defaultWriteObject first.
            @out.DefaultWriteObject();

            // Write our version number.
            @out.WriteByte(1);
            @out.WriteByte(0);
            if (Parameters_Renamed == null)
            {
                @out.WriteInt(-1);
                return;
            }
            @out.WriteInt(Parameters_Renamed.Length);
            // Write string values for the parameters.
            for (int i = 0; i < Parameters_Renamed.Length; i++)
            {
                if (Parameters_Renamed[i] == null)
                {
                    @out.WriteObject(null);
                }
                else
                {
                    @out.WriteObject(Parameters_Renamed[i].ToString());
                }
            }
        }
        /// <summary>
        /// Serializes this <code>DragSourceContext</code>. This method first
        /// performs default serialization. Next, this object's
        /// <code>Transferable</code> is written out if and only if it can be
        /// serialized. If not, <code>null</code> is written instead. In this case,
        /// a <code>DragSourceContext</code> created from the resulting deserialized
        /// stream will contain a dummy <code>Transferable</code> which supports no
        /// <code>DataFlavor</code>s. Finally, this object's
        /// <code>DragSourceListener</code> is written out if and only if it can be
        /// serialized. If not, <code>null</code> is written instead.
        ///
        /// @serialData The default serializable fields, in alphabetical order,
        ///             followed by either a <code>Transferable</code> instance, or
        ///             <code>null</code>, followed by either a
        ///             <code>DragSourceListener</code> instance, or
        ///             <code>null</code>.
        /// @since 1.4
        /// </summary>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException
        private void WriteObject(ObjectOutputStream s)
        {
            s.DefaultWriteObject();

            s.WriteObject(SerializationTester.Test(Transferable_Renamed) ? Transferable_Renamed : null);
            s.WriteObject(SerializationTester.Test(Listener) ? Listener : null);
        }
        /// <summary>
        /// Write out the default serializable data, after ensuring the
        /// <code>zoneStrings</code> field is initialized in order to make
        /// sure the backward compatibility.
        ///
        /// @since 1.6
        /// </summary>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: private void writeObject(java.io.ObjectOutputStream stream) throws java.io.IOException
        private void WriteObject(ObjectOutputStream stream)
        {
            if (ZoneStrings_Renamed == null)
            {
                ZoneStrings_Renamed = TimeZoneNameUtility.getZoneStrings(Locale);
            }
            stream.DefaultWriteObject();
        }
Exemple #7
0
        /// <summary>
        /// Serializes this <code>DragSource</code>. This method first performs
        /// default serialization. Next, it writes out this object's
        /// <code>FlavorMap</code> if and only if it can be serialized. If not,
        /// <code>null</code> is written instead. Next, it writes out
        /// <code>Serializable</code> listeners registered with this
        /// object. Listeners are written in a <code>null</code>-terminated sequence
        /// of 0 or more pairs. The pair consists of a <code>String</code> and an
        /// <code>Object</code>; the <code>String</code> indicates the type of the
        /// <code>Object</code> and is one of the following:
        /// <ul>
        /// <li><code>dragSourceListenerK</code> indicating a
        ///     <code>DragSourceListener</code> object;
        /// <li><code>dragSourceMotionListenerK</code> indicating a
        ///     <code>DragSourceMotionListener</code> object.
        /// </ul>
        ///
        /// @serialData Either a <code>FlavorMap</code> instance, or
        ///      <code>null</code>, followed by a <code>null</code>-terminated
        ///      sequence of 0 or more pairs; the pair consists of a
        ///      <code>String</code> and an <code>Object</code>; the
        ///      <code>String</code> indicates the type of the <code>Object</code>
        ///      and is one of the following:
        ///      <ul>
        ///      <li><code>dragSourceListenerK</code> indicating a
        ///          <code>DragSourceListener</code> object;
        ///      <li><code>dragSourceMotionListenerK</code> indicating a
        ///          <code>DragSourceMotionListener</code> object.
        ///      </ul>.
        /// @since 1.4
        /// </summary>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException
        private void WriteObject(ObjectOutputStream s)
        {
            s.DefaultWriteObject();

            s.WriteObject(SerializationTester.Test(FlavorMap_Renamed) ? FlavorMap_Renamed : null);

            DnDEventMulticaster.Save(s, DragSourceListenerK, Listener);
            DnDEventMulticaster.Save(s, DragSourceMotionListenerK, MotionListener);
            s.WriteObject(null);
        }
Exemple #8
0
        /// <summary>
        /// WriteObject is called to save the state of the PropertyPermission
        /// to a stream. The actions are serialized, and the superclass
        /// takes care of the name.
        /// </summary>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: private synchronized void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException
        private void WriteObject(ObjectOutputStream s)
        {
            lock (this)
            {
                // Write out the actions. The superclass takes care of the name
                // call getActions to make sure actions field is initialized
                if (Actions_Renamed == null)
                {
                    Actions;
                }
                s.DefaultWriteObject();
            }
        }
        /// <summary>
        /// Write the persistence state of the object.
        /// </summary>

//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: private void writeObject(java.io.ObjectOutputStream oos) throws java.io.IOException
        private void WriteObject(ObjectOutputStream oos)
        {
            /*
             * don't serialize if we are delegated and the delegator is not also
             * serializable.
             */

            if (!Equals(BeanContextChildPeer_Renamed) && !(BeanContextChildPeer_Renamed is Serializable))
            {
                throw new IOException("BeanContextChildSupport beanContextChildPeer not Serializable");
            }

            else
            {
                oos.DefaultWriteObject();
            }
        }
Exemple #10
0
        /// <summary>
        /// Serialize this {@code CertificateRevokedException} instance.
        ///
        /// @serialData the size of the extensions map (int), followed by all of
        /// the extensions in the map, in no particular order. For each extension,
        /// the following data is emitted: the OID String (Object), the criticality
        /// flag (boolean), the length of the encoded extension value byte array
        /// (int), and the encoded extension value bytes.
        /// </summary>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: private void writeObject(java.io.ObjectOutputStream oos) throws java.io.IOException
        private void WriteObject(ObjectOutputStream oos)
        {
            // Write out the non-transient fields
            // (revocationDate, reason, authority)
            oos.DefaultWriteObject();

            // Write out the size (number of mappings) of the extensions map
            oos.WriteInt(Extensions_Renamed.Count);

            // For each extension in the map, the following are emitted (in order):
            // the OID String (Object), the criticality flag (boolean), the length
            // of the encoded extension value byte array (int), and the encoded
            // extension value byte array. The extensions themselves are emitted
            // in no particular order.
            foreach (java.util.Map_Entry <String, Extension> entry in Extensions_Renamed)
            {
                Extension ext = entry.Value;
                oos.WriteObject(ext.Id);
                oos.WriteBoolean(ext.Critical);
                sbyte[] extVal = ext.Value;
                oos.WriteInt(extVal.Length);
                oos.Write(extVal);
            }
        }
Exemple #11
0
        /// <summary>
        /// Serializes this <code>DragGestureRecognizer</code>. This method first
        /// performs default serialization. Then, this object's
        /// <code>DragGestureListener</code> is written out if and only if it can be
        /// serialized. If not, <code>null</code> is written instead.
        ///
        /// @serialData The default serializable fields, in alphabetical order,
        ///             followed by either a <code>DragGestureListener</code>, or
        ///             <code>null</code>.
        /// @since 1.4
        /// </summary>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException
        private void WriteObject(ObjectOutputStream s)
        {
            s.DefaultWriteObject();

            s.WriteObject(SerializationTester.Test(DragGestureListener) ? DragGestureListener : null);
        }
 //
 // serialization magic
 //
 /// <summary>Overridden serialization method: compacts our map before writing.</summary>
 /// <param name="out">Stream to write to</param>
 /// <exception cref="System.IO.IOException">If IO error</exception>
 private void WriteObject(ObjectOutputStream @out)
 {
     Compact();
     @out.DefaultWriteObject();
 }
 /// <summary>Saves the state to a stream (that is, serializes it).</summary>
 /// <param name="s">the stream</param>
 /// <exception cref="System.IO.IOException">if an I/O error occurs</exception>
 /// <serialData>
 /// The current value is emitted (a
 /// <c>double</c>
 /// ).
 /// </serialData>
 private void WriteObject(ObjectOutputStream s)
 {
     s.DefaultWriteObject();
     s.WriteDouble(Get());
 }