Exemplo n.º 1
0
        public ArrByte64K CreateArrByte64K()
        {
            _arrByte64K.arrByte64K[0] = (byte)(_i >> 8);
            _arrByte64K.arrByte64K[1] = (byte)(_i);//0,1字节存储_i的大小
            _arrByte64K.len           = _i;
            var ar = _arrByte64K;

            _arrByte64K = null;
            return(ar);
        }
Exemplo n.º 2
0
 public void Put(ArrByte64K arrByte64K)
 {
     if (_queue.Count % 1000 == 0 && _queue.Count > 0)
     {
         LogFile(string.Format("App_ArrByte64KPool--------------{0}", _queue.Count.ToString()));
     }
     if (arrByte64K == null)
     {
         throw new Exception();
     }
     lock (_queue)
     {
         _queue.Enqueue(arrByte64K);
     }
 }
Exemplo n.º 3
0
        public static OperationRequest CreateOperationRequest(ArrByte64K arrByte64K)
        {
            ArrByteReader reader = new ArrByteReader();

            reader.SetArrByte(arrByte64K);
            OperationRequest operationRequest = new OperationRequest();

            operationRequest.OperationCode = reader.ReadByte();
            operationRequest.Parameters    = new Dictionary <byte, object>();
            while (reader.ReadLen < arrByte64K.len)
            {
                byte      key   = reader.ReadByte();
                ValueType type  = (ValueType)reader.ReadByte();
                object    value = null;//reader.ReadUTF8String();
                switch (type)
                {
                case ValueType.EnumInt: { value = reader.ReadInt(); } break;

                case ValueType.Boolean: { value = reader.ReadBool(); } break;

                case ValueType.Byte: { value = reader.ReadByte(); } break;

                case ValueType.Int16: { value = reader.ReadShort(); } break;

                case ValueType.Int32: { value = reader.ReadInt(); } break;

                case ValueType.Int64: { value = reader.ReadLong(); } break;

                case ValueType.SByte: { value = reader.ReadSByte(); } break;

                case ValueType.String: { value = reader.ReadUTF8String(); } break;

                case ValueType.UInt16: { value = reader.ReaduShort(); } break;

                case ValueType.UInt32: { value = reader.ReadUint(); } break;

                case ValueType.UInt64: { value = reader.ReaduLong(); } break;
                }
                operationRequest.Parameters.Add(key, value);
            }
            return(operationRequest);
        }
Exemplo n.º 4
0
 public void SetArrByte(ArrByte64K arrByte)
 {
     _arrByte = arrByte;
     _readLen = 0;
 }