コード例 #1
0
        /// <summary>
        /// Deserialize the {@code CertificateRevokedException} instance.
        /// </summary>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: private void readObject(java.io.ObjectInputStream ois) throws java.io.IOException, ClassNotFoundException
        private void ReadObject(ObjectInputStream ois)
        {
            // Read in the non-transient fields
            // (revocationDate, reason, authority)
            ois.DefaultReadObject();

            // Defensively copy the revocation date
            RevocationDate_Renamed = new DateTime(RevocationDate_Renamed.Ticks);

            // Read in the size (number of mappings) of the extensions map
            // and create the extensions map
            int size = ois.ReadInt();

            if (size == 0)
            {
                Extensions_Renamed = Collections.EmptyMap();
            }
            else
            {
                Extensions_Renamed = new Dictionary <String, Extension>(size);
            }

            // Read in the extensions and put the mappings in the extensions map
            for (int i = 0; i < size; i++)
            {
                String  oid      = (String)ois.ReadObject();
                bool    critical = ois.ReadBoolean();
                int     length   = ois.ReadInt();
                sbyte[] extVal   = new sbyte[length];
                ois.ReadFully(extVal);
                Extension ext = sun.security.x509.Extension.newExtension(new ObjectIdentifier(oid), critical, extVal);
                Extensions_Renamed[oid] = ext;
            }
        }
コード例 #2
0
ファイル: ObjectId.cs プロジェクト: TetradogOther/NGit
 /// <exception cref="System.IO.IOException"></exception>
 private void ReadObject(ObjectInputStream ois)
 {
     w1 = ois.ReadInt();
     w2 = ois.ReadInt();
     w3 = ois.ReadInt();
     w4 = ois.ReadInt();
     w5 = ois.ReadInt();
 }
コード例 #3
0
        /// <summary>
        /// Deserialize this Object in a manner which is binary-compatible with
        /// the JDK.
        /// </summary>
        /// <exception cref="System.IO.IOException"/>
        /// <exception cref="System.TypeLoadException"/>
        private void ReadObject(ObjectInputStream s)
        {
            int    size;
            int    expectedMaxSize;
            object o;

            expectedMaxSize = s.ReadInt();
            size            = s.ReadInt();
            map             = new IdentityHashMap <E, bool>(expectedMaxSize);
            for (int i = 0; i < size; i++)
            {
                o = s.ReadObject();
                InternalAdd(ErasureUtils.UncheckedCast <E>(o));
            }
        }
コード例 #4
0
        /// <exception cref="System.IO.IOException"></exception>
        /// <exception cref="System.TypeLoadException"></exception>
        private void ReadObject(ObjectInputStream @in)
        {
            string name  = (string)@in.ReadObject();
            string value = (string)@in.ReadObject();

            clientCookie = new BasicClientCookie(name, value);
            clientCookie.SetComment((string)@in.ReadObject());
            clientCookie.SetDomain((string)@in.ReadObject());
            clientCookie.SetExpiryDate((DateTime)@in.ReadObject());
            clientCookie.SetPath((string)@in.ReadObject());
            clientCookie.SetVersion(@in.ReadInt());
            clientCookie.SetSecure(@in.ReadBoolean());
        }
コード例 #5
0
ファイル: LogRecord.cs プロジェクト: ranganathsb/JavaSharp
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
        private void ReadObject(ObjectInputStream @in)
        {
            // We have to call defaultReadObject first.
            @in.DefaultReadObject();

            // Read version number.
            sbyte major = @in.ReadByte();
            sbyte minor = @in.ReadByte();

            if (major != 1)
            {
                throw new IOException("LogRecord: bad version: " + major + "." + minor);
            }
            int len = @in.ReadInt();

            if (len == -1)
            {
                Parameters_Renamed = null;
            }
            else
            {
                Parameters_Renamed = new Object[len];
                for (int i = 0; i < Parameters_Renamed.Length; i++)
                {
                    Parameters_Renamed[i] = @in.ReadObject();
                }
            }
            // If necessary, try to regenerate the resource bundle.
            if (ResourceBundleName_Renamed != null)
            {
                try
                {
                    // use system class loader to ensure the ResourceBundle
                    // instance is a different instance than null loader uses
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final ResourceBundle bundle = ResourceBundle.getBundle(resourceBundleName, Locale.getDefault(), ClassLoader.getSystemClassLoader());
                    ResourceBundle bundle = ResourceBundle.GetBundle(ResourceBundleName_Renamed, Locale.Default, ClassLoader.SystemClassLoader);
                    ResourceBundle_Renamed = bundle;
                }
                catch (MissingResourceException)
                {
                    // This is not a good place to throw an exception,
                    // so we simply leave the resourceBundle null.
                    ResourceBundle_Renamed = null;
                }
            }

            NeedToInferCaller = false;
        }
コード例 #6
0
        /// <exception cref="System.IO.IOException"/>
        /// <exception cref="System.TypeLoadException"/>
        /// <exception cref="System.InvalidCastException"/>
        public ClassifierCombiner(ObjectInputStream ois, Properties props)
            : base(PropertiesUtils.OverWriteProperties((Properties)ois.ReadObject(), props))
        {
            // constructor for building a ClassifierCombiner from an ObjectInputStream
            // read the initial Properties out of the ObjectInputStream so you can properly start the AbstractSequenceClassifier
            // note now we load in props from command line and overwrite any that are given for command line
            // read another copy of initProps that I have helpfully included
            // TODO: probably set initProps in AbstractSequenceClassifier to avoid this writing twice thing, its hacky
            this.initProps = PropertiesUtils.OverWriteProperties((Properties)ois.ReadObject(), props);
            // read the initLoadPaths
            this.initLoadPaths = (List <string>)ois.ReadObject();
            // read the combinationMode from the serialized version
            string cm = (string)ois.ReadObject();

            // see if there is a commandline override for the combinationMode, else set newCM to the serialized version
            ClassifierCombiner.CombinationMode newCM;
            if (props.GetProperty("ner.combinationMode") != null)
            {
                // there is a possible commandline override, have to see if its valid
                try
                {
                    // see if the commandline has a proper value
                    newCM = ClassifierCombiner.CombinationMode.ValueOf(props.GetProperty("ner.combinationMode"));
                }
                catch (ArgumentException)
                {
                    // the commandline override did not have a proper value, so just use the serialized version
                    newCM = ClassifierCombiner.CombinationMode.ValueOf(cm);
                }
            }
            else
            {
                // there was no commandline override given, so just use the serialized version
                newCM = ClassifierCombiner.CombinationMode.ValueOf(cm);
            }
            this.combinationMode = newCM;
            // read in the base classifiers
            int numClassifiers = ois.ReadInt();

            // set up the list of base classifiers
            this.baseClassifiers = new List <AbstractSequenceClassifier <IN> >();
            int i = 0;

            while (i < numClassifiers)
            {
                try
                {
                    log.Info("loading CRF...");
                    CRFClassifier <IN> newCRF = ErasureUtils.UncheckedCast(CRFClassifier.GetClassifier(ois, props));
                    baseClassifiers.Add(newCRF);
                    i++;
                }
                catch (Exception)
                {
                    try
                    {
                        log.Info("loading CMM...");
                        CMMClassifier newCMM = ErasureUtils.UncheckedCast(CMMClassifier.GetClassifier(ois, props));
                        baseClassifiers.Add(newCMM);
                        i++;
                    }
                    catch (Exception ex)
                    {
                        throw new IOException("Couldn't load classifier!", ex);
                    }
                }
            }
        }
コード例 #7
0
 /// <exception cref="System.IO.IOException"/>
 /// <exception cref="System.TypeLoadException"/>
 private void ReadObject(ObjectInputStream @in)
 {
     byte[] buf = new byte[@in.ReadInt()];
     @in.ReadFully(buf);
     metadata = new KeyProvider.Metadata(buf);
 }