Ejemplo n.º 1
0
        /// <summary>
        /// 从制定索引处绑定数据
        /// </summary>
        /// <param name="readableStm">可读的字节流</param>
        /// <param name="posBeginAt">开始位置</param>
        /// <param name="isJustMapingBind">是否只绑定数据索引映射信息</param>
        public override void BindStreamWithBeginIndex(Stream readableStm, long posBeginAt, bool isJustMapingBind)
        {
            MappingRange[0] = posBeginAt;
            JustMapped      = isJustMapingBind;

            byte tByte = (byte)readableStm.ReadByte();

            Type = (ImageType)tByte;
            if (Type == ImageType.NULL)
            {
                BinaryDat = null;
            }
            else
            {
                BLV bData = new BLV(Context);
                bData.BindStreamWithBeginIndex(readableStm, readableStm.Position, isJustMapingBind);
                BinaryDat = bData;
            }
            MappingRange[1] = readableStm.Position - 1;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Binds the mapping with stream.
        /// </summary>
        /// <param name="mapStm">The map STM.</param>
        public override void BindMappingWithStream(Stream mapStm)
        {
            JustMapped = false;
            SetCurrentPosition(mapStm);

            mapStm.Position = MappingRange[0];
            byte tByte = (byte)mapStm.ReadByte();

            Type = (ImageType)tByte;
            if (Type == ImageType.NULL)
            {
                BinaryDat = null;
            }
            else
            {
                BLV bData = new BLV(Context);
                bData.BindMappingWithStream(mapStm);
                BinaryDat = bData;
            }
            RestorePosition(mapStm);
        }