0
mirror of https://github.com/sampletext32/ParkanPlayground.git synced 2025-05-21 12:51:18 +03:00

Added XML documentation comments to buffer reading methods in InstructionDecoder

This commit is contained in:
bird_egop 2025-04-13 23:36:53 +03:00
parent 6827cb735e
commit 8d1522b6cb

View File

@ -227,6 +227,33 @@ public class InstructionDecoder
{ {
return _prefixDecoder.HasOperandSizePrefix(); return _prefixDecoder.HasOperandSizePrefix();
} }
/// <summary>
/// Checks if a single byte can be read from the current position
/// </summary>
/// <returns>True if there is at least one byte available to read</returns>
public bool CanReadByte()
{
return _position < _length;
}
/// <summary>
/// Checks if a 16-bit unsigned short (2 bytes) can be read from the current position
/// </summary>
/// <returns>True if there are at least two bytes available to read</returns>
public bool CanReadUShort()
{
return _position + 1 < _length;
}
/// <summary>
/// Checks if a 32-bit unsigned integer (4 bytes) can be read from the current position
/// </summary>
/// <returns>True if there are at least four bytes available to read</returns>
public bool CanReadUInt()
{
return _position + 3 < _length;
}
/// <summary> /// <summary>
/// Reads a byte from the buffer and advances the position /// Reads a byte from the buffer and advances the position