Exemplo n.º 1
0
		/// <summary>
		/// Reads the state of a
		/// <code>StringBuilder</code>
		/// from the passed stream and
		/// restores it to this instance.
		/// </summary>
		/// <param name="in">the stream to read the state from.</param>
		/// <exception cref="System.IO.IOException">if the stream throws it during the read.</exception>
		/// <exception cref="ClassNotFoundException">if the stream throws it during the read.
		/// 	</exception>
		/// <exception cref="java.lang.ClassNotFoundException"></exception>
		private void readObject(java.io.ObjectInputStream @in)
		{
			@in.defaultReadObject();
			int count = @in.readInt();
			char[] value = (char[])@in.readObject();
			set(value, count);
		}
Exemplo n.º 2
0
        private void readObject(java.io.ObjectInputStream ois)
        {
            try
            {
                m_modelData = null;
                InitFileNames();

                int version = ois.readInt();
                if (version == 2)
                {
                    int n = ois.readInt();
                    m_modelData = new byte[n];
                    int m = 0;
                    while (true)
                    {
                        int mm = ois.read(m_modelData, m, n - m);
                        m += mm;
                        if (m >= n)
                            break;
                    }
                    ois.readBoolean();
                    m_delta = ois.readDouble();

                    System.IO.File.WriteAllBytes(m_modelFile, m_modelData);
                }
                else if (version == 3)
                {
                    int n = ois.readInt();
                    m_modelData = new byte[n];
                    int m = 0;
                    while (true)
                    {
                        int mm = ois.read(m_modelData, m, n - m);
                        m += mm;
                        if (m >= n)
                            break;
                    }
                    Boolean b = ois.readBoolean();
                    if (b)
                    {
                        m_mustValue = ois.readInt();
                    }
                    else
                    {
                        ois.readInt();
                    }
                    m_delta = ois.readDouble();

                    System.IO.File.WriteAllBytes(m_modelFile, m_modelData);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }