mirror of https://github.com/libAthena/athena.git
* Add missing readUByte to stream
This commit is contained in:
parent
2731ac3dff
commit
9c38e96403
|
@ -122,6 +122,14 @@ public:
|
|||
* \throw IOException
|
||||
*/
|
||||
virtual Int8 readByte();
|
||||
|
||||
/*! \brief Reads a byte at the current position and advances the current position
|
||||
*
|
||||
* \return Uint8 The value at the current position
|
||||
* \throw IOException
|
||||
*/
|
||||
virtual Uint8 readUByte();
|
||||
|
||||
/*! \brief Reads a byte at the current position and advances the current position.
|
||||
*
|
||||
* \return Uint8* The buffer at the current position from the given length.
|
||||
|
|
|
@ -198,6 +198,19 @@ Int8 Stream::readByte()
|
|||
return *(Int8*)(m_data + m_position++);
|
||||
}
|
||||
|
||||
Uint8 Stream::readUByte()
|
||||
{
|
||||
if (m_bitPosition > 0)
|
||||
{
|
||||
m_bitPosition = 0;
|
||||
m_position += sizeof(Uint8);
|
||||
}
|
||||
if (m_position + 1 > m_length)
|
||||
throw error::IOException("Stream::readUByte -> Position passed stream bounds");
|
||||
|
||||
return *(Uint8*)(m_data + m_position++);
|
||||
}
|
||||
|
||||
Uint8 *Stream::readUBytes(Int64 length)
|
||||
{
|
||||
return (Uint8*)readBytes(length);
|
||||
|
|
Loading…
Reference in New Issue