refactor: Update Unity to 2022.3.62
This commit is contained in:
@@ -25,7 +25,7 @@ namespace Cryville.Common {
|
||||
/// <param name="encoding">The encoding of the string.</param>
|
||||
/// <returns>The string read from the reader.</returns>
|
||||
public static string ReadUInt16String(this BinaryReader reader, Encoding encoding = null) {
|
||||
if (encoding == null) encoding = Encoding.UTF8;
|
||||
encoding ??= Encoding.UTF8;
|
||||
var len = reader.ReadUInt16();
|
||||
byte[] buffer = reader.ReadBytes(len);
|
||||
return encoding.GetString(buffer);
|
||||
@@ -38,7 +38,7 @@ namespace Cryville.Common {
|
||||
/// <param name="value">The string to write by the writer.</param>
|
||||
/// <param name="encoding">The encoding of the string.</param>
|
||||
public static void WriteUInt16String(this BinaryWriter writer, string value, Encoding encoding = null) {
|
||||
if (encoding == null) encoding = Encoding.UTF8;
|
||||
encoding ??= Encoding.UTF8;
|
||||
byte[] buffer = encoding.GetBytes(value);
|
||||
writer.Write((ushort)buffer.Length);
|
||||
writer.Write(buffer);
|
||||
|
Reference in New Issue
Block a user