Exemple #1
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());
                }
            }
        }
Exemple #2
0
 /// <exception cref="System.IO.IOException"></exception>
 private void WriteObject(ObjectOutputStream os)
 {
     os.WriteInt(w1);
     os.WriteInt(w2);
     os.WriteInt(w3);
     os.WriteInt(w4);
     os.WriteInt(w5);
 }
        /// <summary>
        /// Serialize this Object in a manner which is binary-compatible with the
        /// JDK.
        /// </summary>
        /// <exception cref="System.IO.IOException"/>
        private void WriteObject(ObjectOutputStream s)
        {
            IEnumerator <E> it = GetEnumerator();

            s.WriteInt(Count * 2);
            // expectedMaxSize
            s.WriteInt(Count);
            while (it.MoveNext())
            {
                s.WriteObject(it.Current);
            }
        }
 // method for writing a ClassifierCombiner to an ObjectOutputStream
 public override void SerializeClassifier(ObjectOutputStream oos)
 {
     try
     {
         // record the properties used to initialize
         oos.WriteObject(initProps);
         // this is a bit of a hack, but have to write this twice so you can get it again
         // after you initialize AbstractSequenceClassifier
         // basically when this is read from the ObjectInputStream, I read it once to call
         // super(props) and then I read it again so I can set this.initProps
         // TODO: probably should have AbstractSequenceClassifier store initProps to get rid of this double writing
         oos.WriteObject(initProps);
         // record the initial loadPaths
         oos.WriteObject(initLoadPaths);
         // record the combinationMode
         string combinationModeString = combinationMode.ToString();
         oos.WriteObject(combinationModeString);
         // get the number of classifiers to write to disk
         int numClassifiers = baseClassifiers.Count;
         oos.WriteInt(numClassifiers);
         // go through baseClassifiers and write each one to disk with CRFClassifier's serialize method
         log.Info(string.Empty);
         foreach (AbstractSequenceClassifier <IN> asc in baseClassifiers)
         {
             //CRFClassifier crfc = (CRFClassifier) asc;
             //log.info("Serializing a base classifier...");
             asc.SerializeClassifier(oos);
         }
     }
     catch (IOException e)
     {
         throw new RuntimeIOException(e);
     }
 }
 /// <exception cref="System.IO.IOException"></exception>
 private void WriteObject(ObjectOutputStream @out)
 {
     @out.WriteObject(cookie.GetName());
     @out.WriteObject(cookie.GetValue());
     @out.WriteObject(cookie.GetComment());
     @out.WriteObject(cookie.GetDomain());
     @out.WriteObject(cookie.GetExpiryDate());
     @out.WriteObject(cookie.GetPath());
     @out.WriteInt(cookie.GetVersion());
     @out.WriteBoolean(cookie.IsSecure());
 }
Exemple #6
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);
            }
        }
 /// <exception cref="System.IO.IOException"/>
 private void WriteObject(ObjectOutputStream @out)
 {
     byte[] serialized = metadata.Serialize();
     @out.WriteInt(serialized.Length);
     @out.Write(serialized);
 }