blob: c62db61faad532d46579be7700b4ab68b0bad4de (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
//
// Author:
// Jb Evain (jbevain@gmail.com)
//
// Copyright (c) 2008 - 2015 Jb Evain
// Copyright (c) 2008 - 2011 Novell, Inc.
//
// Licensed under the MIT/X11 license.
//
using System;
namespace Mono.Cecil.Metadata {
sealed class GuidHeap : Heap {
public GuidHeap (byte [] data)
: base (data)
{
}
public Guid Read (uint index)
{
if (index == 0)
return new Guid ();
const int guid_size = 16;
var buffer = new byte [guid_size];
index--;
Buffer.BlockCopy (this.data, (int) index, buffer, 0, guid_size);
return new Guid (buffer);
}
}
}
|