Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/HeuristicLab.ExtLibs/HeuristicLab.Cecil/0.9.5/Mono.Cecil-0.9.5/Symbols/Mono.Cecil.Pdb/Microsoft.Cci.Pdb/PdbReader.cs @ 15682

Last change on this file since 15682 was 11700, checked in by jkarder, 10 years ago

#2077: created branch and added first version

File size: 911 bytes
Line 
1//-----------------------------------------------------------------------------
2//
3// Copyright (C) Microsoft Corporation.  All Rights Reserved.
4//
5//-----------------------------------------------------------------------------
6using System;
7using System.IO;
8
9namespace Microsoft.Cci.Pdb {
10  internal class PdbReader {
11    internal PdbReader(Stream reader, int pageSize) {
12      this.pageSize = pageSize;
13      this.reader = reader;
14    }
15
16    internal void Seek(int page, int offset) {
17      reader.Seek(page * pageSize + offset, SeekOrigin.Begin);
18    }
19
20    internal void Read(byte[] bytes, int offset, int count) {
21      reader.Read(bytes, offset, count);
22    }
23
24    internal int PagesFromSize(int size) {
25      return (size + pageSize - 1) / (pageSize);
26    }
27
28    internal int PageSize {
29      get { return pageSize; }
30    }
31
32    internal readonly int pageSize;
33    internal readonly Stream reader;
34  }
35}
Note: See TracBrowser for help on using the repository browser.