Skip to content

Commit

Permalink
Simplify Read/Write byte
Browse files Browse the repository at this point in the history
  • Loading branch information
Havret committed Mar 7, 2024
1 parent fe5ec9a commit e2f77cd
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/ArtemisNetCoreClient/ByteBuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,12 @@ public bool ReadBool()

public void WriteByte(byte value)
{
Span<byte> buffer = stackalloc byte[1] { value };
_memoryStream.Write(buffer);
_memoryStream.WriteByte(value);
}

public byte ReadByte()
{
Span<byte> buffer = stackalloc byte[1];
_ = _memoryStream.Read(buffer);
return buffer[0];
return (byte) _memoryStream.ReadByte();
}

public void WriteInt(int value)
Expand Down

0 comments on commit e2f77cd

Please sign in to comment.