Line | |
---|
1 | //----------------------------------------------------------------------------- |
---|
2 | // |
---|
3 | // Copyright (C) Microsoft Corporation. All Rights Reserved. |
---|
4 | // |
---|
5 | //----------------------------------------------------------------------------- |
---|
6 | using System; |
---|
7 | using System.IO; |
---|
8 | |
---|
9 | namespace 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.