コード例 #1
0
            public BigInteger readinto([NotNull] ArrayModule.array buffer)
            {
                _checkClosed();

                int len     = Math.Min(_length - _pos, buffer.__len__() * buffer.itemsize);
                int tailLen = len % buffer.itemsize;

                buffer.FromStream(new MemoryStream(_data, _pos, len - tailLen, false, false), 0);
                _pos += len - tailLen;

                if (tailLen != 0)
                {
                    byte[] tail = buffer.RawGetItem(len / buffer.itemsize);
                    for (int i = 0; i < tailLen; i++)
                    {
                        tail[i] = _data[_pos++];
                    }
                    buffer.FromStream(new MemoryStream(tail), len / buffer.itemsize);
                }

                return(len);
            }
コード例 #2
0
            public BigInteger readinto([NotNull] ArrayModule.array buffer)
            {
                EnsureReadable();

                return((int)buffer.FromStream(_readStream, 0, buffer.__len__() * buffer.itemsize));
            }