From 43363baa44d00864cd533ac94bc0f1a3673d3dbf Mon Sep 17 00:00:00 2001 From: James Frowen Date: Mon, 10 Jun 2024 14:11:46 +0100 Subject: [PATCH] feat: making PadToByte public this is sometimes needed when using CopyFromWriter to correctly align data --- Assets/Mirage/Runtime/Serialization/NetworkReader.cs | 2 +- Assets/Mirage/Runtime/Serialization/NetworkWriter.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/Mirage/Runtime/Serialization/NetworkReader.cs b/Assets/Mirage/Runtime/Serialization/NetworkReader.cs index b4dbb2c46ac..b05c006fcc9 100644 --- a/Assets/Mirage/Runtime/Serialization/NetworkReader.cs +++ b/Assets/Mirage/Runtime/Serialization/NetworkReader.cs @@ -184,7 +184,7 @@ private void ThrowPositionOverLength(int newPosition) throw new EndOfStreamException($"Can not read over end of buffer, new position {newPosition}, length {_bitLength} bits"); } - private void PadToByte() + public void PadToByte() { _bitPosition = BytePosition << 3; } diff --git a/Assets/Mirage/Runtime/Serialization/NetworkWriter.cs b/Assets/Mirage/Runtime/Serialization/NetworkWriter.cs index 9ba842518ac..8120fdc280d 100644 --- a/Assets/Mirage/Runtime/Serialization/NetworkWriter.cs +++ b/Assets/Mirage/Runtime/Serialization/NetworkWriter.cs @@ -196,7 +196,7 @@ private void ThrowLengthOverCapacity(int newLength) throw new InvalidOperationException($"Can not write over end of buffer, new length {newLength}, capacity {_bitCapacity}"); } - private void PadToByte() + public void PadToByte() { _bitPosition = ByteLength << 3; }