mirror of https://github.com/icsharpcode/ILSpy.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
743 B
39 lines
743 B
// Copyright (c) Cristian Civera (cristian@aspitalia.com) |
|
// This code is distributed under the MS-PL (for details please see \doc\MS-PL.txt) |
|
|
|
using System; |
|
using System.IO; |
|
|
|
namespace Ricciolo.StylesExplorer.MarkupReflection |
|
{ |
|
internal class BamlBinaryReader : BinaryReader |
|
{ |
|
// Methods |
|
public BamlBinaryReader(Stream stream) |
|
: base(stream) |
|
{ |
|
} |
|
|
|
public virtual double ReadCompressedDouble() |
|
{ |
|
switch (this.ReadByte()) { |
|
case 1: |
|
return 0; |
|
case 2: |
|
return 1; |
|
case 3: |
|
return -1; |
|
case 4: |
|
return ReadInt32() * 1E-06; |
|
case 5: |
|
return this.ReadDouble(); |
|
} |
|
throw new NotSupportedException(); |
|
} |
|
|
|
public int ReadCompressedInt32() |
|
{ |
|
return base.Read7BitEncodedInt(); |
|
} |
|
} |
|
} |