21 private RuntimeType _typeToDeserialize;
23 private ObjectReader _objectReader;
25 internal ObjectReader ObjectReader
33 _objectReader = value;
37 internal void ExpectingToDeserialize(RuntimeType type)
39 _typeToDeserialize = type;
42 [SecuritySafeCritical]
43 public override Type BindToType(
string assemblyName,
string typeName)
47 string[] typesSafeForDeserialization = TypesSafeForDeserialization;
48 foreach (
string asmTypeName
in typesSafeForDeserialization)
56 Type type = ObjectReader.FastBindToType(assemblyName, typeName);
71 private const int ENUM_DONE =
int.MinValue;
73 private const int ENUM_NOT_STARTED = -1;
77 private bool _currentIsValid;
79 private int _currentName;
81 private int _dataPosition;
85 [SecuritySafeCritical]
88 if (_currentName ==
int.MinValue)
96 if (_reader._resCache ==
null)
100 return _reader.AllocateStringForNameIndex(_currentName, out _dataPosition);
104 public object Current => Entry;
106 internal int DataPosition => _dataPosition;
110 [SecuritySafeCritical]
113 if (_currentName ==
int.MinValue)
117 if (!_currentIsValid)
121 if (_reader._resCache ==
null)
129 lock (_reader._resCache)
131 key = _reader.AllocateStringForNameIndex(_currentName, out _dataPosition);
132 if (_reader._resCache.
TryGetValue(key, out ResourceLocator value))
138 obj = ((_dataPosition != -1) ? _reader.LoadObject(_dataPosition) : _reader.GetValueForNameIndex(_currentName));
150 if (_currentName ==
int.MinValue)
154 if (!_currentIsValid)
158 if (_reader._resCache ==
null)
162 return _reader.GetValueForNameIndex(_currentName);
173 public bool MoveNext()
175 if (_currentName == _reader._numResources - 1 || _currentName ==
int.MinValue)
177 _currentIsValid =
false;
178 _currentName =
int.MinValue;
181 _currentIsValid =
true;
188 if (_reader._resCache ==
null)
192 _currentIsValid =
false;
197 private const int DefaultFileStreamBufferSize = 4096;
203 private long _nameSectionOffset;
205 private long _dataSectionOffset;
207 private int[] _nameHashes;
210 private unsafe
int* _nameHashesPtr;
212 private int[] _namePositions;
215 private unsafe
int* _namePositionsPtr;
217 private RuntimeType[] _typeTable;
219 private int[] _typeNamePositions;
223 private int _numResources;
227 private int _version;
229 private bool[] _safeToDeserialize;
231 private TypeLimitingDeserializationBinder _typeLimitingBinder;
233 private static readonly
string[] TypesSafeForDeserialization =
new string[21]
235 "System.String[], mscorlib, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a",
236 "System.DateTime[], mscorlib, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a",
237 "System.Drawing.Bitmap, System.Drawing, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a",
238 "System.Drawing.Imaging.Metafile, System.Drawing, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a",
239 "System.Drawing.Point, System.Drawing, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a",
240 "System.Drawing.PointF, System.Drawing, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a",
241 "System.Drawing.Size, System.Drawing, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a",
242 "System.Drawing.SizeF, System.Drawing, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a",
243 "System.Drawing.Font, System.Drawing, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a",
244 "System.Drawing.Icon, System.Drawing, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a",
245 "System.Drawing.Color, System.Drawing, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a",
246 "System.Windows.Forms.Cursor, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089",
247 "System.Windows.Forms.Padding, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089",
248 "System.Windows.Forms.LinkArea, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089",
249 "System.Windows.Forms.ImageListStreamer, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089",
250 "System.Windows.Forms.ListViewGroup, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089",
251 "System.Windows.Forms.ListViewItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089",
252 "System.Windows.Forms.ListViewItem+ListViewSubItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089",
253 "System.Windows.Forms.ListViewItem+ListViewSubItem+SubItemStyle, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089",
254 "System.Windows.Forms.OwnerDrawPropertyBag, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089",
255 "System.Windows.Forms.TreeNode, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089" 264 [SecuritySafeCritical]
305 _resCache = resCache;
323 [SecuritySafeCritical]
324 private unsafe
void Dispose(
bool disposing)
336 _namePositions =
null;
339 _namePositionsPtr =
null;
340 _nameHashesPtr =
null;
345 internal unsafe
static int ReadUnalignedI4(
int* p)
347 return *(
byte*)p | (((
byte*)p)[1] << 8) | (((
byte*)p)[2] << 16) | (((
byte*)p)[3] << 24);
350 private void SkipInt32()
355 private void SkipString()
360 throw new BadImageFormatException(Environment.GetResourceString(
"BadImageFormat_NegativeStringLength"));
365 [SecuritySafeCritical]
366 private unsafe
int GetNameHash(
int index)
370 return _nameHashes[index];
372 return ReadUnalignedI4(_nameHashesPtr + index);
375 [SecuritySafeCritical]
376 private unsafe
int GetNamePosition(
int index)
378 int num = (_ums !=
null) ? ReadUnalignedI4(_namePositionsPtr + index) : _namePositions[index];
379 if (num < 0 || num > _dataSectionOffset - _nameSectionOffset)
381 throw new FormatException(Environment.GetResourceString(
"BadImageFormat_ResourcesNameInvalidOffset", num));
391 return GetEnumerator();
399 if (_resCache ==
null)
403 return new ResourceEnumerator(
this);
406 internal ResourceEnumerator GetEnumeratorInternal()
408 return new ResourceEnumerator(
this);
411 internal int FindPosForResource(
string name)
413 int num = FastResourceComparer.HashFunction(name);
415 int i = _numResources - 1;
420 num3 = num2 + i >> 1;
421 int nameHash = GetNameHash(num3);
422 int num4 = (nameHash != num) ? ((nameHash >= num) ? 1 : (-1)) : 0;
444 while (num2 > 0 && GetNameHash(num2 - 1) == num)
451 for (i = num3; i < _numResources - 1 && GetNameHash(i + 1) == num; i++)
457 for (
int j = num2; j <= i; j++)
460 if (CompareStringEqualsName(name))
465 throw new FormatException(Environment.GetResourceString(
"BadImageFormat_ResourcesDataInvalidOffset", num5));
474 [SecuritySafeCritical]
475 private unsafe
bool CompareStringEqualsName(
string name)
480 throw new BadImageFormatException(Environment.GetResourceString(
"BadImageFormat_NegativeStringLength"));
488 throw new BadImageFormatException(Environment.GetResourceString(
"BadImageFormat_ResourcesNameTooLong"));
490 return FastResourceComparer.CompareOrdinal(positionPointer, num, name) == 0;
492 byte[] array =
new byte[num];
494 for (
int num2 = num; num2 > 0; num2 -= num3)
496 num3 = _store.
Read(array, num - num2, num2);
499 throw new BadImageFormatException(Environment.GetResourceString(
"BadImageFormat_ResourceNameCorrupted"));
502 return FastResourceComparer.CompareOrdinal(array, num / 2, name) == 0;
506 private unsafe
string AllocateStringForNameIndex(
int index, out
int dataOffset)
508 long num = GetNamePosition(index);
517 throw new BadImageFormatException(Environment.GetResourceString(
"BadImageFormat_NegativeStringLength"));
523 throw new BadImageFormatException(Environment.GetResourceString(
"BadImageFormat_ResourcesIndexTooLong", index));
527 text =
new string(positionPointer, 0, num2 / 2);
530 if (dataOffset < 0 || dataOffset >= _store.
BaseStream.
Length - _dataSectionOffset)
532 throw new FormatException(Environment.GetResourceString(
"BadImageFormat_ResourcesDataInvalidOffset", dataOffset));
536 array =
new byte[num2];
538 for (
int num3 = num2; num3 > 0; num3 -= num4)
540 num4 = _store.
Read(array, num2 - num3, num3);
543 throw new EndOfStreamException(Environment.GetResourceString(
"BadImageFormat_ResourceNameCorrupted_NameIndex", index));
547 if (dataOffset < 0 || dataOffset >= _store.
BaseStream.
Length - _dataSectionOffset)
549 throw new FormatException(Environment.GetResourceString(
"BadImageFormat_ResourcesDataInvalidOffset", dataOffset));
555 private object GetValueForNameIndex(
int index)
557 long num = GetNamePosition(index);
565 throw new FormatException(Environment.GetResourceString(
"BadImageFormat_ResourcesDataInvalidOffset", num2));
569 return LoadObjectV1(num2);
571 ResourceTypeCode typeCode;
572 return LoadObjectV2(num2, out typeCode);
576 internal string LoadString(
int pos)
579 string result =
null;
587 if (FindType(num) != typeof(
string))
589 throw new InvalidOperationException(Environment.GetResourceString(
"InvalidOperation_ResourceNotString_Type", FindType(num).FullName));
595 ResourceTypeCode resourceTypeCode = (ResourceTypeCode)num;
596 if (resourceTypeCode != ResourceTypeCode.String && resourceTypeCode != 0)
598 string text = (resourceTypeCode >= ResourceTypeCode.StartOfUserTypes) ? FindType((
int)(resourceTypeCode - 64)).FullName : resourceTypeCode.ToString();
599 throw new InvalidOperationException(Environment.GetResourceString(
"InvalidOperation_ResourceNotString_Type", text));
601 if (resourceTypeCode == ResourceTypeCode.String)
609 internal object LoadObject(
int pos)
613 return LoadObjectV1(pos);
615 ResourceTypeCode typeCode;
616 return LoadObjectV2(pos, out typeCode);
619 internal object LoadObject(
int pos, out ResourceTypeCode typeCode)
623 object obj = LoadObjectV1(pos);
624 typeCode = ((obj is string) ? ResourceTypeCode.String : ResourceTypeCode.StartOfUserTypes);
627 return LoadObjectV2(pos, out typeCode);
630 internal object LoadObjectV1(
int pos)
634 return _LoadObjectV1(pos);
638 throw new BadImageFormatException(Environment.GetResourceString(
"BadImageFormat_TypeMismatch"), inner);
640 catch (ArgumentOutOfRangeException inner2)
642 throw new BadImageFormatException(Environment.GetResourceString(
"BadImageFormat_TypeMismatch"), inner2);
646 [SecuritySafeCritical]
647 private object _LoadObjectV1(
int pos)
655 RuntimeType left = FindType(num);
656 if (left == typeof(
string))
660 if (left == typeof(
int))
664 if (left == typeof(
byte))
668 if (left == typeof(sbyte))
672 if (left == typeof(
short))
676 if (left == typeof(
long))
680 if (left == typeof(ushort))
684 if (left == typeof(uint))
688 if (left == typeof(ulong))
692 if (left == typeof(
float))
696 if (left == typeof(
double))
700 if (left == typeof(DateTime))
704 if (left == typeof(TimeSpan))
708 if (left == typeof(decimal))
710 int[] array =
new int[4];
711 for (
int i = 0; i < array.Length; i++)
715 return new decimal(array);
717 return DeserializeObject(num);
720 internal object LoadObjectV2(
int pos, out ResourceTypeCode typeCode)
724 return _LoadObjectV2(pos, out typeCode);
728 throw new BadImageFormatException(Environment.GetResourceString(
"BadImageFormat_TypeMismatch"), inner);
730 catch (ArgumentOutOfRangeException inner2)
732 throw new BadImageFormatException(Environment.GetResourceString(
"BadImageFormat_TypeMismatch"), inner2);
736 [SecuritySafeCritical]
737 private unsafe
object _LoadObjectV2(
int pos, out ResourceTypeCode typeCode)
743 case ResourceTypeCode.Null:
745 case ResourceTypeCode.String:
747 case ResourceTypeCode.Boolean:
749 case ResourceTypeCode.Char:
751 case ResourceTypeCode.Byte:
753 case ResourceTypeCode.SByte:
755 case ResourceTypeCode.Int16:
757 case ResourceTypeCode.UInt16:
759 case ResourceTypeCode.Int32:
761 case ResourceTypeCode.UInt32:
763 case ResourceTypeCode.Int64:
765 case ResourceTypeCode.UInt64:
767 case ResourceTypeCode.Single:
769 case ResourceTypeCode.Double:
771 case ResourceTypeCode.Decimal:
773 case ResourceTypeCode.DateTime:
776 return DateTime.FromBinary(dateData);
778 case ResourceTypeCode.TimeSpan:
781 return new TimeSpan(ticks);
783 case ResourceTypeCode.ByteArray:
788 throw new BadImageFormatException(Environment.GetResourceString(
"BadImageFormat_ResourceDataLengthInvalid", num2));
794 throw new BadImageFormatException(Environment.GetResourceString(
"BadImageFormat_ResourceDataLengthInvalid", num2));
800 throw new BadImageFormatException(Environment.GetResourceString(
"BadImageFormat_ResourceDataLengthInvalid", num2));
802 byte[] array2 =
new byte[num2];
803 int num3 = _ums.
Read(array2, 0, num2);
806 case ResourceTypeCode.Stream:
811 throw new BadImageFormatException(Environment.GetResourceString(
"BadImageFormat_ResourceDataLengthInvalid", num));
816 return new PinnedBufferMemoryStream(array);
820 throw new BadImageFormatException(Environment.GetResourceString(
"BadImageFormat_ResourceDataLengthInvalid", num));
826 if (typeCode < ResourceTypeCode.StartOfUserTypes)
828 throw new BadImageFormatException(Environment.GetResourceString(
"BadImageFormat_TypeMismatch"));
830 int typeIndex = (int)(typeCode - 64);
831 return DeserializeObject(typeIndex);
837 private object DeserializeObject(
int typeIndex)
839 RuntimeType runtimeType = FindType(typeIndex);
840 if (_safeToDeserialize ==
null)
842 InitSafeToDeserializeArray();
845 if (_safeToDeserialize[typeIndex])
847 _objFormatter.
Binder = _typeLimitingBinder;
848 _typeLimitingBinder.ExpectingToDeserialize(runtimeType);
853 _objFormatter.
Binder =
null;
856 if (obj.GetType() != runtimeType)
858 throw new BadImageFormatException(Environment.GetResourceString(
"BadImageFormat_ResType&SerBlobMismatch", runtimeType.FullName, obj.GetType().FullName));
864 private void ReadResources()
867 _typeLimitingBinder =
new TypeLimitingDeserializationBinder();
868 binaryFormatter.
Binder = _typeLimitingBinder;
869 _objFormatter = binaryFormatter;
876 throw new BadImageFormatException(Environment.GetResourceString(
"BadImageFormat_ResourcesHeaderCorrupted"), inner);
878 catch (IndexOutOfRangeException inner2)
880 throw new BadImageFormatException(Environment.GetResourceString(
"BadImageFormat_ResourcesHeaderCorrupted"), inner2);
885 private unsafe
void _ReadResources()
888 if (num != ResourceManager.MagicNumber)
890 throw new ArgumentException(Environment.GetResourceString(
"Resources_StreamNotValid"));
894 if (num3 < 0 || num2 < 0)
896 throw new BadImageFormatException(Environment.GetResourceString(
"BadImageFormat_ResourcesHeaderCorrupted"));
906 if (!ResourceManager.CompareNames(text, ResourceManager.ResReaderTypeName, asmName))
908 throw new NotSupportedException(Environment.GetResourceString(
"NotSupported_WrongResourceReader_Type", text));
913 if (num4 != 2 && num4 != 1)
915 throw new ArgumentException(Environment.GetResourceString(
"Arg_ResourceFileUnsupportedVersion", 2, num4));
919 if (_numResources < 0)
921 throw new BadImageFormatException(Environment.GetResourceString(
"BadImageFormat_ResourcesHeaderCorrupted"));
926 throw new BadImageFormatException(Environment.GetResourceString(
"BadImageFormat_ResourcesHeaderCorrupted"));
928 _typeTable =
new RuntimeType[num5];
929 _typeNamePositions =
new int[num5];
930 for (
int i = 0; i < num5; i++)
936 int num6 = (int)position & 7;
939 for (
int j = 0; j < 8 - num6; j++)
946 _nameHashes =
new int[_numResources];
947 for (
int k = 0; k < _numResources; k++)
954 if ((_numResources & 3758096384u) != 0L)
956 throw new BadImageFormatException(Environment.GetResourceString(
"BadImageFormat_ResourcesHeaderCorrupted"));
958 int num7 = 4 * _numResources;
965 _namePositions =
new int[_numResources];
966 for (
int l = 0; l < _numResources; l++)
971 throw new BadImageFormatException(Environment.GetResourceString(
"BadImageFormat_ResourcesHeaderCorrupted"));
973 _namePositions[l] = num8;
978 if ((_numResources & 3758096384u) != 0
L)
980 throw new BadImageFormatException(Environment.GetResourceString(
"BadImageFormat_ResourcesHeaderCorrupted"));
982 int num9 = 4 * _numResources;
988 if (_dataSectionOffset < 0)
990 throw new BadImageFormatException(Environment.GetResourceString(
"BadImageFormat_ResourcesHeaderCorrupted"));
993 if (_dataSectionOffset < _nameSectionOffset)
995 throw new BadImageFormatException(Environment.GetResourceString(
"BadImageFormat_ResourcesHeaderCorrupted"));
999 private RuntimeType FindType(
int typeIndex)
1001 if (typeIndex < 0 || typeIndex >= _typeTable.Length)
1003 throw new BadImageFormatException(Environment.GetResourceString(
"BadImageFormat_InvalidType"));
1005 if (_typeTable[typeIndex] ==
null)
1012 _typeTable[typeIndex] = (RuntimeType)
Type.GetType(typeName, throwOnError:
true);
1019 return _typeTable[typeIndex];
1023 private void InitSafeToDeserializeArray()
1025 _safeToDeserialize =
new bool[_typeTable.Length];
1026 for (
int i = 0; i < _typeTable.Length; i++)
1039 RuntimeType runtimeType = (RuntimeType)
Type.GetType(text, throwOnError:
false);
1042 if (runtimeType ==
null)
1044 assemblyName =
null;
1049 if (runtimeType.BaseType == typeof(Enum))
1051 _safeToDeserialize[i] =
true;
1056 RuntimeAssembly runtimeAssembly = (RuntimeAssembly)runtimeType.Assembly;
1059 string[] typesSafeForDeserialization = TypesSafeForDeserialization;
1060 foreach (
string asmTypeName
in typesSafeForDeserialization)
1062 if (ResourceManager.CompareNames(asmTypeName, typeName, assemblyName))
1064 _safeToDeserialize[i] =
true;
1083 public void GetResourceData(
string resourceName, out
string resourceType, out
byte[] resourceData)
1085 if (resourceName ==
null)
1089 if (_resCache ==
null)
1093 int[] array =
new int[_numResources];
1094 int num = FindPosForResource(resourceName);
1101 for (
int i = 0; i < _numResources; i++)
1119 long num5 = (num4 < _numResources - 1) ? (array[num4 + 1] + _dataSectionOffset) : _store.
BaseStream.
Length;
1120 int num6 = (int)(num5 - (num + _dataSectionOffset));
1123 if (resourceTypeCode < ResourceTypeCode.Null || (
int)resourceTypeCode >= 64 + _typeTable.Length)
1127 resourceType = TypeNameFromTypeCode(resourceTypeCode);
1130 if (array2.Length != num6)
1134 resourceData = array2;
1138 private string TypeNameFromTypeCode(ResourceTypeCode typeCode)
1140 if (typeCode < ResourceTypeCode.StartOfUserTypes)
1142 return "ResourceTypeCode." + typeCode.
ToString();
1144 int num = (int)(typeCode - 64);
Represents a character encoding.To browse the .NET Framework source code for this type,...
override string ToString()
Creates and returns a string representation of the current exception.
override long Length
Gets the length of the data in a stream.
virtual void Close()
Closes the current reader and the underlying stream.
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
unsafe string GetString(byte *bytes, int byteCount)
When overridden in a derived class, decodes a specified number of bytes starting at a specified addre...
The exception that is thrown when reading is attempted past the end of a stream.
IDictionaryEnumerator GetEnumerator()
Returns an enumerator for this T:System.Resources.ResourceReader object.
FileOptions
Represents advanced options for creating a T:System.IO.FileStream object.
override long Position
Gets or sets the current position in a stream.
virtual int ReadInt32()
Reads a 4-byte signed integer from the current stream and advances the current position of the stream...
ResourceReader(Stream stream)
Initializes a new instance of the T:System.Resources.ResourceReader class for the specified stream.
void Dispose()
Releases all resources used by the current instance of the T:System.Resources.ResourceReader class.
Allows users to control class loading and mandate what class to load.
virtual ulong ReadUInt64()
Reads an 8-byte unsigned integer from the current stream and advances the position of the stream by e...
FileMode
Specifies how the operating system should open a file.
static Encoding Unicode
Gets an encoding for the UTF-16 format using the little endian byte order.
Provides a mechanism for releasing unmanaged resources.To browse the .NET Framework source code for t...
Specifies the current position within a stream.
void Close()
Releases all operating system resources associated with this T:System.Resources.ResourceReader object...
AssemblyNameFlags
Provides information about an T:System.Reflection.Assembly reference.
virtual decimal ReadDecimal()
Reads a decimal value from the current stream and advances the current position of the stream by sixt...
unsafe override int Read([In] [Out] byte[] buffer, int offset, int count)
Reads the specified number of bytes into the specified array.
static string GetFileName(string path)
Returns the file name and extension of the specified path string.
Describes the source and destination of a given serialized stream, and provides an additional caller-...
void GetResourceData(string resourceName, out string resourceType, out byte[] resourceData)
Retrieves the type name and data of a named resource from an open resource file or stream.
virtual byte ReadByte()
Reads the next byte from the current stream and advances the current position of the stream by one by...
virtual bool IsEnum
Gets a value indicating whether the current T:System.Type represents an enumeration.
Represents a resource manager that provides convenient access to culture-specific resources at run ti...
virtual ushort ReadUInt16()
Reads a 2-byte unsigned integer from the current stream using little-endian encoding and advances the...
A type representing a date and time value.
SeekOrigin
Specifies the position in a stream to use for seeking.
Provides the base functionality for reading data from resource files.
virtual short ReadInt16()
Reads a 2-byte signed integer from the current stream and advances the current position of the stream...
abstract bool CanRead
When overridden in a derived class, gets a value indicating whether the current stream supports readi...
virtual uint ReadUInt32()
Reads a 4-byte unsigned integer from the current stream and advances the position of the stream by fo...
Exposes an enumerator, which supports a simple iteration over a non-generic collection....
Provides information about, and means to manipulate, the current environment and platform....
virtual sbyte ReadSByte()
Reads a signed byte from this stream and advances the current position of the stream by one byte.
static void Sort(Array array)
Sorts the elements in an entire one-dimensional T:System.Array using the T:System....
unsafe byte * PositionPointer
Gets or sets a byte pointer to a stream based on the current position in the stream.
virtual byte [] ReadBytes(int count)
Reads the specified number of bytes from the current stream into a byte array and advances the curren...
virtual bool ReadBoolean()
Reads a Boolean value from the current stream and advances the current position of the stream by one ...
Provides a T:System.IO.Stream for a file, supporting both synchronous and asynchronous read and write...
Reads primitive data types as binary values in a specific encoding.
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Represents type declarations: class types, interface types, array types, value types,...
virtual int Read()
Reads characters from the underlying stream and advances the current position of the stream in accord...
abstract long Seek(long offset, SeekOrigin origin)
When overridden in a derived class, sets the position within the current stream.
static int BinarySearch(Array array, object value)
Searches an entire one-dimensional sorted array for a specific element, using the T:System....
IEnumerator GetEnumerator()
Returns an enumerator that iterates through a collection.
Enumerates the resources in a binary resources (.resources) file by reading sequential resource name/...
AssemblyVersionCompatibility
Defines the different types of assembly version compatibility. This feature is not available in versi...
Describes an assembly's unique identity in full.
override long Seek(long offset, SeekOrigin loc)
Sets the current position of the current stream to the given value.
virtual Stream BaseStream
Exposes access to the underlying stream of the T:System.IO.BinaryReader.
The exception that is thrown when one of the arguments provided to a method is not valid.
abstract long Length
When overridden in a derived class, gets the length in bytes of the stream.
virtual unsafe float ReadSingle()
Reads a 4-byte floating point value from the current stream and advances the current position of the ...
FileAccess
Defines constants for read, write, or read/write access to a file.
abstract long Position
When overridden in a derived class, gets or sets the position within the current stream.
Enumerates the elements of a nongeneric dictionary.
virtual unsafe double ReadDouble()
Reads an 8-byte floating point value from the current stream and advances the current position of the...
static Encoding UTF8
Gets an encoding for the UTF-8 format.
The exception that is thrown when a method call is invalid for the object's current state.
virtual string ReadString()
Reads a string from the current stream. The string is prefixed with the length, encoded as an integer...
Provides access to unmanaged blocks of memory from managed code.
StreamingContextStates
Defines a set of flags that specifies the source or destination context for the stream during seriali...
ResourceReader(string fileName)
Initializes a new instance of the T:System.Resources.ResourceReader class for the specified named res...
virtual long ReadInt64()
Reads an 8-byte signed integer from the current stream and advances the current position of the strea...
Defines a dictionary key/value pair that can be set or retrieved.
bool TryGetValue(TKey key, out TValue value)
Gets the value associated with the specified key.
internal int Read7BitEncodedInt()
Reads in a 32-bit integer in compressed format.
Supports a simple iteration over a non-generic collection.
Performs operations on T:System.String instances that contain file or directory path information....
string FullName
Gets the full name of the assembly, also known as the display name.
AssemblyHashAlgorithm
Specifies all the hash algorithms used for hashing files and for generating the strong name.
FileShare
Contains constants for controlling the kind of access other T:System.IO.FileStream objects can have t...
Provides a generic view of a sequence of bytes. This is an abstract class.To browse the ....