Create() public static méthode

public static Create ( Stream input, Encoding encoding, Endian endian ) : BinaryReader
input Stream
encoding System.Text.Encoding
endian Endian
Résultat System.IO.BinaryReader
Exemple #1
0
        /// <summary>
        /// Initializes a new instance of <see cref="StreamByteSource"/>.
        /// </summary>
        /// <param name="stream">Stream to read from.</param>
        public StreamByteSource(Stream stream)
        {
            _stream = stream;
            _endian = Endian.LocalMachine;
            _reader = EndianBinaryReader.Create(_stream, _endian);
            _mark   = 0;

            this.LargeObjectSize = 64 * 1024;

            _milestones = new Stack <long>();
            _lock       = new object();
        }
Exemple #2
0
        public FileByteSource(FileReference file)
        {
            _file   = file;
            _stream = _file.OpenRead();
            _endian = Endian.LocalMachine;
            _reader = EndianBinaryReader.Create(_stream, _endian);
            _mark   = 0;

            _largeObjectSize = 64 * 1024;

            _milestones = new Stack <long>();
            _lock       = new object();
        }
Exemple #3
0
        /// <summary>
        /// Initializes a new instance of <see cref="StreamByteSource"/>.
        /// </summary>
        /// <param name="stream">Stream to read from.</param>
        public StreamByteSource(Stream stream, FileReadOption readOption = FileReadOption.Default)
        {
            _stream = stream;
            _endian = Endian.LocalMachine;
            _reader = EndianBinaryReader.Create(_stream, _endian);
            _mark   = 0;
            // here the mapping of the default option is applied - may be extracted into some GlobalSettings class or similar
            _readOption = (readOption == FileReadOption.Default) ? FileReadOption.ReadLargeOnDemand : readOption;

            LargeObjectSize = 64 * 1024;

            _milestones = new Stack <long>();
            _lock       = new object();
        }
Exemple #4
0
        /// <summary>
        /// Initializes an instance of <see cref="FileByteSource"/>.
        /// </summary>
        /// <param name="file">File to read from.</param>
        public FileByteSource(IFileReference file, FileReadOption readOption)
        {
            _file   = file;
            _stream = _file.OpenRead();
            _endian = Endian.LocalMachine;
            _reader = EndianBinaryReader.Create(_stream, _endian);
            Marker  = 0;
            // here the mapping of the default option is applied - may be extracted into some GlobalSettings class or similar
            _readOption = (readOption == FileReadOption.Default) ? FileReadOption.ReadLargeOnDemand : readOption;

            LargeObjectSize = 64 * 1024;

            _milestones = new Stack <long>();
            _lock       = new object();
            _disposed   = false;
        }