Bot releases are visible (Hide)
Stream
on EndianBinaryReader
and EndianBinaryWriter
.No breaking changes from v2.1.0
Published by Kermalis over 1 year ago
Int128
/UInt128
.TrimNullTerminators(ref ReadOnlySpan<char> chars)
to EndianBinaryPrimitives
.EndianBinaryPrimitives
that read/write to/from ReadOnlySpan<T>
/Span<T>
. These are similar to their non-_Unsafe
counterparts, aside from the fact that they don't check for errors. Their goal is performance.No breaking changes from v2.0.1
Published by Kermalis about 2 years ago
TrimNullTerminators(ref char[] chars)
and TrimNullTerminators(ref Span<char> chars)
to EndianBinaryPrimitives
which will remove all '\0' from the endReadSBytes(ReadOnlySpan<byte> src, Span<sbyte> dest)
and WriteSBytes(Span<byte> dest, ReadOnlySpan<sbyte> src)
to EndianBinaryPrimitives
EndianBinaryPrimitives
that use the same optimization techniques as the ones in EndianBinaryReader
and EndianBinaryWriter
PeekBytes(Span<byte> dest)
to EndianBinaryReader
No breaking changes from v2.0.0
Published by Kermalis about 2 years ago
Span<T>
and performance in mind. No allocations unless absolutely necessaryReadEnum<TEnum>()
will only include code that will be executed for the given enum size. So passing a TEnum
that is the size of a byte will condense down to just a ReadByte()
call with no size/type checksHalf
, DateOnly
, TimeOnly
, Vector2
, Vector3
, Vector4
, Quaternion
, and Matrix4x4
Encoding
/BooleanSize
, null termination, etc.). The reader/writer now respects its state (such as whether to use ASCII, and which BooleanSize
to use) which you can change at any timedecimal
int order now matches with .net APIsEndianBitConverter
in favor of EndianBinaryPrimitives
, which has similar API while using modern programming like Span<T>
ReadObject()
and WriteObject()
with primitives and other supported types like DateTime
, Vector3
, etc.Encoding
usage. The whole thing was very complicated before, and it barely functioned. Now you have ASCII and .net (UTF16-LE) support by default, and can add your own requirements either by extension methods or inheriting the reader/writerPublished by Kermalis about 4 years ago
charCount
still refers to the amount of UTF16
chars it'd take to store the string. For example, an emoji in UTF32
is one UTF32
char, but two UTF16
chars. For that emoji, charCount
should be 2
when reading and writing.Published by Kermalis about 4 years ago
Published by Kermalis about 4 years ago
v1.1.0
instead of v1.0.4
because it has a few breaking changes; hopefully these are the only breaking changes I will introduce for a really long time.EndianBitConverter
static class. Very similar to System.BitConverter
provided with .NET. It has a property that represents the system's endianness and has methods to convert to/from data types with specified endianness. This means the library does not need to be used with a stream every time you just want a few conversions.BinaryStringTrimNullTerminatorsAttribute
- If you apply this attribute to string or char[] properties in an object, the resulting string/char[] will remove chars starting from the first '\0'. This attribute is optional and is not compatible with BinaryStringNullTerminatedAttribute
.ArgumentOutOfRangeException
when passing in invalid BooleanSize
, Endianness
, or EncodingType
enum valuesEndianBinaryWriter
have had the index
parameter renamed to startIndex
. If you were manually referring to the parameter by its name, then you will need to change it.EndianBinaryReader.ReadChars(int count)
is now EndianBinaryReader.ReadChars(int count, bool trimNullTerminated)
Published by Kermalis about 4 years ago
Published by Kermalis about 4 years ago
EndianBinaryReader.ReadIntoObject(object)
and EndianBinaryWriter.Write(object)
IBinarySerializable
, although you should just call obj.Read()
and obj.Write()
insteadPublished by Kermalis about 4 years ago
This release adds some methods to write strings with a specified number of chars. The string will be truncated to the char count if too many are present, and \0
will be added until the string is the length of the number of chars if the string was too short.
Also included are a few optimizations to EndianBinaryReader.ReadIntoObject()
and EndianBinaryWriter.WriteObject()
.
Published by Kermalis about 4 years ago
Initial release on nuget