Пример #1
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;
            }
        }