示例#1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
        internal void WriteExternal(ObjectOutput @out)
        {
            // HijrahChronology is implicit in the Hijrah_DATE_TYPE
            @out.WriteObject(Chronology);
            @out.WriteInt(get(YEAR));
            @out.WriteByte(get(MONTH_OF_YEAR));
            @out.WriteByte(get(DAY_OF_MONTH));
        }
示例#2
0
        /// <summary>
        /// The object implements the writeExternal method to save its contents
        /// by calling the methods of DataOutput for its primitive values or
        /// calling the writeObject method of ObjectOutput for objects, strings
        /// and arrays. </summary>
        /// <exception cref="IOException"> Includes any I/O exceptions that may occur </exception>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
        public virtual void WriteExternal(ObjectOutput @out)
        {
            String s = ToString();             // contains ASCII chars only

            // one-to-one correspondence between ASCII char and byte in UTF string
            if (s.Length() <= 65535)             // 65535 is max length of UTF string
            {
                @out.WriteUTF(s);
            }
            else
            {
                @out.WriteByte(0);
                @out.WriteByte(0);
                @out.WriteInt(s.Length());
                @out.Write(s.Bytes);
            }
        }