Exemplo n.º 1
0
        public Bcj2DecoderStream(Stream[] streams, byte[] info, long limit)
        {
            if (info != null && info.Length > 0)
            {
                throw new NotSupportedException();
            }

            if (streams.Length != 4)
            {
                throw new NotSupportedException();
            }

            mLimit        = limit;
            mMainStream   = streams[0];
            mCallStream   = streams[1];
            mJumpStream   = streams[2];
            mRangeDecoder = new RangeDecoder(streams[3]);

            mStatusDecoder = new StatusDecoder[256 + 2];
            for (int i = 0; i < mStatusDecoder.Length; i++)
            {
                mStatusDecoder[i] = new StatusDecoder();
            }

            mIter = Run().GetEnumerator();
        }
Exemplo n.º 2
0
        private int Read(byte[] buffer, int offset, int count)
        {
            if (mStatusDecoder == null)
            {
                mStatusDecoder = new StatusDecoder[256 + 2];
                for (int i = 0; i < mStatusDecoder.Length; i++)
                {
                    mStatusDecoder[i] = new StatusDecoder();
                }

                mIter = Run().GetEnumerator();
            }

            var result = DecodeInto(buffer, offset, count);

            mPosition += result;
            return(result);
        }
Exemplo n.º 3
0
        public Bcj2DecoderStream(Stream[] streams, byte[] info, long limit)
        {
            if (info != null && info.Length > 0)
                throw new NotSupportedException();

            if (streams.Length != 4)
                throw new NotSupportedException();

            mMainStream = streams[0];
            mCallStream = streams[1];
            mJumpStream = streams[2];
            mRangeDecoder = new RangeDecoder(streams[3]);

            mStatusDecoder = new StatusDecoder[256 + 2];
            for (int i = 0; i < mStatusDecoder.Length; i++)
                mStatusDecoder[i] = new StatusDecoder();

            mIter = Run().GetEnumerator();
        }
Exemplo n.º 4
0
        private int Read(byte[] buffer, int offset, int count)
        {
            if (mStatusDecoder == null)
            {
                mStatusDecoder = new StatusDecoder[256 + 2];
                for (int i = 0; i < mStatusDecoder.Length; i++)
                    mStatusDecoder[i] = new StatusDecoder();

                mIter = Run().GetEnumerator();
            }

            var result = DecodeInto(buffer, offset, count);
            mPosition += result;
            return result;
        }