Class StreamExtensions
Extension methods that make a effectively into a
binary serializer with no encoding. We simply convert types into bytes
and write them without any concern whether surrogate pairs are respected,
similar to what BinaryFormatter does.
This makes it possible to serialize/deserialize raw character arrays
and get the data back in the same order without any exceptions warning
that the order is not valid and without the need for BinaryFormatter.
Byte order is little-endian (same as and ).
Inheritance
System.Object
StreamExtensions
Assembly: Lucene.Net.dll
Syntax
public static class StreamExtensions : object
Methods
|
Improve this Doc
View Source
ReadChars(Stream, Int32)
Declaration
public static char[] ReadChars(this Stream stream, int count)
Parameters
Type |
Name |
Description |
Stream |
stream |
|
System.Int32 |
count |
|
Returns
Type |
Description |
System.Char[] |
|
|
Improve this Doc
View Source
ReadInt32(Stream)
Declaration
public static int ReadInt32(this Stream stream)
Parameters
Type |
Name |
Description |
Stream |
stream |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
ReadInt64(Stream)
Declaration
public static long ReadInt64(this Stream stream)
Parameters
Type |
Name |
Description |
Stream |
stream |
|
Returns
Type |
Description |
System.Int64 |
|
|
Improve this Doc
View Source
Write(Stream, Char[])
Declaration
public static void Write(this Stream stream, char[] chars)
Parameters
Type |
Name |
Description |
Stream |
stream |
|
System.Char[] |
chars |
|
|
Improve this Doc
View Source
Write(Stream, Int32)
Declaration
public static void Write(this Stream stream, int value)
Parameters
Type |
Name |
Description |
Stream |
stream |
|
System.Int32 |
value |
|
|
Improve this Doc
View Source
Write(Stream, Int64)
Declaration
public static void Write(this Stream stream, long value)
Parameters
Type |
Name |
Description |
Stream |
stream |
|
System.Int64 |
value |
|