72 if (
read (temp, 2) == 2)
82 if (
read (temp, 2) == 2)
92 if (
read (temp, 4) == 4)
102 if (
read (temp, 4) == 4)
115 const int numBytes = (
sizeByte & 0x7f);
126 if (
read (bytes, numBytes) != numBytes)
130 return (
sizeByte >> 7) ? -num : num;
137 if (
read (n.asBytes, 8) == 8)
147 if (
read (n.asBytes, 8) == 8)
155 static_assert (
sizeof (
int32) ==
sizeof (
float),
"Union assumes float has the same size as an int32");
204 if (c == 0 || c ==
'\n')
226 return (
size_t)
mo.writeFromInputStream (*
this, numBytes);
static constexpr uint32 bigEndianInt(const void *bytes) noexcept
Turns 4 bytes into a big-endian integer.
static constexpr uint32 littleEndianInt(const void *bytes) noexcept
Turns 4 bytes into a little-endian integer.
static Type swapIfLittleEndian(Type value) noexcept
Swaps the byte order of a signed or unsigned integer if the CPU is little-endian.
static constexpr uint16 bigEndianShort(const void *bytes) noexcept
Turns 2 bytes into a big-endian integer.
static constexpr uint16 littleEndianShort(const void *bytes) noexcept
Turns 2 bytes into a little-endian integer.
static Type swapIfBigEndian(Type value) noexcept
Swaps the byte order of a signed or unsigned integer if the CPU is big-endian.
Very simple container class to hold a pointer to some data on the heap.
A class to hold a resizable block of raw data.
Writes data to an internal memory buffer, which grows as required.
String toUTF8() const
Returns a String created from the (UTF8) data that has been written to the stream.
String toString() const
Attempts to detect the encoding of the data and convert it to a string.
virtual bool writeByte(char byte)
Writes a single byte to the stream.
constexpr Type jmin(Type a, Type b)
Returns the smaller of two values.
signed int int32
A platform-independent 32-bit signed integer type.
unsigned long long uint64
A platform-independent 64-bit unsigned integer type.
Type * addBytesToPointer(Type *basePointer, IntegerType bytes) noexcept
A handy function which adds a number of bytes to any type of pointer and returns the result.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...
unsigned char uint8
A platform-independent 8-bit unsigned integer type.
long long int64
A platform-independent 64-bit integer type.