Esempio n. 1
0
 public void setNextfile(xDataInput di)
 {
     for (int i = 0; i < 8; i++)
     {
         next_file[i] = di.readByte();
     }
 }
Esempio n. 2
0
        public bool load(xDataInput di)
        {
            mDate = di.readInt();

            mShareID        = di.readInt();
            mCode           = di.readUTF();
            mFloorID        = di.readByte();
            mPriceRef       = di.readFloat();
            mIsIndex        = di.readBoolean();
            mMaxTradeVolume = di.readInt();

            mTradeTransactionCount = di.readInt();
            int cnt = mTradeTransactionCount * FIELD_CNT;

            if (cnt > mTradeTransactionBuffer.Length)
            {
                int[] p = new int[cnt + 20 * FIELD_CNT];
                mTradeTransactionBuffer = p;
            }

            for (int i = 0; i < cnt; i++)
            {
                mTradeTransactionBuffer[i] = di.readInt();
            }

            return(true);
        }
Esempio n. 3
0
        void loadFibonaccie()
        {
            if (!mShouldSaveFile)
            {
                return;
            }
            Share share = mShare;

            if (share == null)
            {
                return;
            }

            string sz = getFilename();

            xDataInput di = xFileManager.readFile(sz, false);

            mTrends.removeAllElements();
            mSelectedTrend = null;
            if (di != null)
            {
                if (di.readInt() == Context.FILE_VERSION)
                {
                    int cnt = di.readInt();
                    for (int i = 0; i < cnt; i++)
                    {
                        stTrendLine t = new stTrendLine();
                        t.type      = di.readByte();
                        t.color     = (uint)di.readInt();
                        t.thickness = di.readFloat();
                        for (int j = 0; j < 3; j++)
                        {
                            t.candleIdx[j] = di.readFloat();
                            Utils.trace("=====loadfile: candle=" + t.candleIdx[j]);
                            t.price[j] = di.readFloat();
                        }

                        if (t.type == DRAW_ABC)
                        {
                            t.data = di.readUTF();
                        }

                        mTrends.addElement(t);
                    }

                    recalcPosition();
                }
            }
            Utils.trace("=====loadfile");
        }
Esempio n. 4
0
        void init(xDataInput di)
        {
            mItemCnt = 0;
            if (di == null || di.available() < 10)
            {
                return;
            }
            //=================================================
            //	item_cnt | header session | data
            //=================================================
            //	header session: flag:1 | offset:3 | size:4, total 8 bytes
            //=================================================
            //check signature
            //========================

            const string sig = "ezze";

            for (int i = 0; i < 4; i++)
            {
                if (di.readByte() != sig[i])
                {
                    return;
                }
            }
            int size0 = di.readInt();   //  little endien
            int size  = Utils.convertBigIntToLittleInt(size0);

            if (di.available() != size + 4)    //  last 4 ezze
            {
                return;
            }
            //=======================================
            //	get number of item
            size0    = di.readInt();
            mItemCnt = Utils.convertBigIntToLittleInt(size0);

            if (mItemCnt > 0)
            {
                //	read header
                size    = 64 * mItemCnt;
                mHeader = new byte[size];
                di.read(mHeader, 0, size);
            }

            mData = di;
        }