예제 #1
0
 public BufferByteReader(DiskReadProvider stream, int buffersize, long streamstart, long streamlen)
 {
     if (buffersize > streamlen)
     {
         buffersize = (int)streamlen;
     }
     this.bufferSize  = buffersize;
     buffer           = new byte[buffersize];
     bufferNext       = new byte[buffersize];
     this.streamStart = streamstart;
     this.streamLen   = streamlen;
     this.stream      = stream;
     UpdateBuffer(pos, true);
 }
예제 #2
0
        public MidiFile(Stream stream, int readBufferSize)
        {
            reader = stream;
            ParseHeaderChunk();
            List <MidiChunkPointer> tracks = new List <MidiChunkPointer>();

            while (reader.Position < reader.Length)
            {
                ParseTrackChunk(tracks);
            }
            TrackLocations = tracks.ToArray();
            TrackCount     = TrackLocations.Length;
            readProvider   = new DiskReadProvider(stream);
        }