jaulib v1.4.0-2-g788cf73
Jau Support Library (C++, Java, ..)
Loading...
Searching...
No Matches
jau::io::ByteStream Class Referenceabstract

Byte stream interface. More...

#include <byte_stream.hpp>

Inheritance diagram for jau::io::ByteStream:
Collaboration diagram for jau::io::ByteStream:

Public Types

typedef uint64_t size_type
 uint64_t size data type, bit position and count
 

Public Member Functions

 ByteStream (iomode_t mode, lb_endian_t byteOrder=lb_endian_t::little) noexcept
 
 ~ByteStream () noexcept override=default
 
virtual bool available (size_t n) noexcept=0
 Return whether n bytes are available in the input stream, if has_content_size() or using an asynchronous source.
 
constexpr lb_endian_t byteOrder () const noexcept
 Returns endian byte-order of stream storage.
 
constexpr bool canRead () const noexcept
 Returns true in case stream has iomode::read capabilities.
 
virtual bool canRewind () const noexcept=0
 Return true if implementation supports random rewinding the stream, i.e.
 
constexpr bool canWrite () const noexcept
 Returns true in case stream has iomode::write capabilities.
 
virtual void close () noexcept=0
 Close the stream if supported by the underlying mechanism.
 
virtual size_type contentSize () const noexcept=0
 Returns the content_size if known.
 
virtual size_t discard (size_t N) noexcept=0
 Discard the next N bytes of the data.
 
virtual void flush () noexcept=0
 Synchronizes all output operations, or do nothing.
 
virtual bool hasContentSize () const noexcept=0
 Returns true if implementation is aware of content_size(), otherwise false.
 
virtual std::string id () const noexcept
 return the id of this data source
 
virtual bool isOpen () const noexcept=0
 Checks if the stream has an associated file.
 
virtual size_type mark () const noexcept=0
 Returns the markpos set via setMark() or ByteStream::npos if unset.
 
virtual size_type markReadLimit () const noexcept=0
 Returns the readLimit set via setMark().
 
constexpr iomode_t mode () const noexcept
 
bool peek (uint8_t &out) noexcept
 Peek one byte at current position.
 
virtual size_t peek (void *out, size_t length, size_type peek_offset) noexcept=0
 Read from the source but do not modify the internal offset.
 
virtual size_type position () const noexcept=0
 Returns the position indicator, similar to e.g.
 
bool read (uint8_t &bits) noexcept
 Read one byte, uint8_t
 
virtual size_t read (void *out, size_t length) noexcept=0
 Read from the source.
 
bool readS16 (int16_t &bits) noexcept
 Read int16_t.
 
bool readS32 (int32_t &bits) noexcept
 Read int32_t.
 
bool readS64 (int64_t &bits) noexcept
 Read int64_t.
 
bool readU16 (uint16_t &bits) noexcept
 Read uint16_t.
 
bool readU32 (uint32_t &bits) noexcept
 Read incoming uint32_t.
 
bool readU64 (uint64_t &bits) noexcept
 Read incoming uint64_t.
 
bool readU64Raw (uint64_t &bits) noexcept
 Read incoming uint64_t w/o considering bigEndian, i.e.
 
virtual size_type remaining () const noexcept
 Returns the remaining bytes, i.e.
 
virtual size_type seek (size_type newPos) noexcept=0
 Sets position indicator for output-streams or input-streams with known length, similar to e.g.
 
virtual bool seekMark () noexcept=0
 Seeks stream position to markpos as set via setMark().
 
void setImmutable () noexcept
 Clears iomode_t::write from mode()
 
virtual bool setMark (size_type readLimit) noexcept=0
 Set markpos to current position, allowing the stream to be seekMark().
 
virtual std::string toString () const noexcept=0
 
virtual size_t write (const void *in, size_t length) noexcept=0
 Write to the data sink.
 
bool write (uint8_t in) noexcept
 Write one byte, uint8_t.
 
bool writeS16 (int16_t bits) noexcept
 Write the given int16_t.
 
bool writeS32 (int32_t bits) noexcept
 Write the given int32_t.
 
bool writeS64 (int64_t bits) noexcept
 Write the given int64_t.
 
bool writeU16 (uint16_t bits) noexcept
 Write the given uint16_t.
 
bool writeU32 (uint32_t bits) noexcept
 Write the given uint32_t.
 
bool writeU64 (uint64_t bits) noexcept
 Write the given uint64_t.
 
bool writeU64Raw (uint64_t bits) noexcept
 Write the given uint64_t w/o considering bigEndian, i.e.
 
- Public Member Functions inherited from jau::io::IOStateCap
 IOStateCap () noexcept
 
 IOStateCap (const IOStateCap &o) noexcept=default
 
 IOStateCap (IOStateCap &&o) noexcept=default
 
virtual ~IOStateCap () noexcept=default
 
void addState (const iostate_t state) noexcept
 Adds given state flags to existing rdstate() bits.
 
virtual void assignState (const iostate_t state=iostate_t::goodbit) noexcept
 Assigns given state to current value.
 
bool bad () const noexcept
 Checks if a non-recoverable error has occurred.
 
void clear (const iostate_t state=iostate_t::goodbit) noexcept
 Clears state flags by assignment to the given value.
 
void clearStateFlags (const iostate_t clr) noexcept
 Clears given state flags from current value.
 
bool eof () const noexcept
 Checks if end-of-file has been reached.
 
bool fail () const noexcept
 Checks if an error has occurred.
 
bool good () const noexcept
 Checks if no error nor eof() has occurred i.e.
 
 operator bool () const noexcept
 Checks if no error has occurred, synonym of !fail().
 
bool operator! () const noexcept
 Checks if an error has occurred, synonym of fail().
 
IOStateCapoperator= (const IOStateCap &o) noexcept=default
 
IOStateCapoperator= (IOStateCap &&o) noexcept=default
 
virtual iostate_t rdstate () const noexcept
 Returns the current state flags.
 
void setstate (const iostate_t state) noexcept
 Sets state flags, by keeping its previous bits.
 
bool timeout () const noexcept
 Checks if a timeout (non-recoverable) has occurred.
 

Static Public Attributes

static constexpr size_type npos = std::numeric_limits<size_type>::max()
 Invalid position constant, denoting unset mark() or invalid position.
 

Protected Member Functions

size_t discardRead (size_t n) noexcept
 Fallback slow discard implementation usind read() in case of unknown stream size.
 
- Protected Member Functions inherited from jau::io::IOStateCap
constexpr void addstate_impl (iostate_t state) const noexcept
 
constexpr iostate_t rdstate_impl () const noexcept
 

Protected Attributes

lb_endian_t m_byteOrder
 
iomode_t m_iomode
 

Detailed Description

Byte stream interface.

ByteInStream Properties

The byte input stream can originate from a local source w/o delay, remote URL like http connection or even from another thread feeding the input buffer.
Both latter asynchronous resources may expose blocking properties in available().

Asynchronous resources benefit from knowing their content size, as their available() implementation may avoid blocking and waiting for requested bytes available if the stream is already beyond its scope.

All method implementations are of noexcept.

One may use fail() to detect whether an error has occurred, while end_of_data() not only covers the end-of-stream (EOS) case but includes fail().

See also
ByteInStream Properties

Definition at line 185 of file byte_stream.hpp.

Member Typedef Documentation

◆ size_type

uint64_t size data type, bit position and count

Definition at line 188 of file byte_stream.hpp.

Constructor & Destructor Documentation

◆ ByteStream()

jau::io::ByteStream::ByteStream ( iomode_t mode,
lb_endian_t byteOrder = lb_endian_t::little )
inlinenoexcept
Parameters
modeiomode_t
byteOrderendian byte-order of stream storage, defaults to lb_endian_t::little. Only affects multi-byte r/w operations, e.g. readU16(), writeU16(), etc

Definition at line 206 of file byte_stream.hpp.

Here is the caller graph for this function:

◆ ~ByteStream()

jau::io::ByteStream::~ByteStream ( )
overridedefaultnoexcept

Member Function Documentation

◆ discardRead()

size_t ByteStream::discardRead ( size_t n)
protectednoexcept

Fallback slow discard implementation usind read() in case of unknown stream size.

Definition at line 87 of file byte_stream.cpp.

Here is the caller graph for this function:

◆ mode()

iomode_t jau::io::ByteStream::mode ( ) const
inlineconstexprnoexcept

Definition at line 211 of file byte_stream.hpp.

Here is the caller graph for this function:

◆ setImmutable()

void jau::io::ByteStream::setImmutable ( )
inlinenoexcept

Clears iomode_t::write from mode()

Definition at line 214 of file byte_stream.hpp.

◆ byteOrder()

lb_endian_t jau::io::ByteStream::byteOrder ( ) const
inlineconstexprnoexcept

Returns endian byte-order of stream storage.

Only affects multi-byte r/w operations, e.g. readU16(), writeU16(), etc.

Definition at line 221 of file byte_stream.hpp.

Here is the caller graph for this function:

◆ canRead()

bool jau::io::ByteStream::canRead ( ) const
inlineconstexprnoexcept

Returns true in case stream has iomode::read capabilities.

Definition at line 224 of file byte_stream.hpp.

Here is the caller graph for this function:

◆ canWrite()

bool jau::io::ByteStream::canWrite ( ) const
inlineconstexprnoexcept

Returns true in case stream has iomode::write capabilities.

Definition at line 227 of file byte_stream.hpp.

Here is the caller graph for this function:

◆ isOpen()

virtual bool jau::io::ByteStream::isOpen ( ) const
pure virtualnoexcept

Checks if the stream has an associated file.

Implemented in jau::io::ByteInStream_Feed, jau::io::ByteInStream_URL, jau::io::ByteStream_File, jau::io::ByteStream_Recorder, and jau::io::ByteStream_SecMemory.

Here is the caller graph for this function:

◆ close()

virtual void jau::io::ByteStream::close ( )
pure virtualnoexcept

Close the stream if supported by the underlying mechanism.

Implemented in jau::io::ByteInStream_Feed, jau::io::ByteInStream_URL, jau::io::ByteStream_File, jau::io::ByteStream_Recorder, and jau::io::ByteStream_SecMemory.

Here is the caller graph for this function:

◆ id()

virtual std::string jau::io::ByteStream::id ( ) const
inlinevirtualnoexcept

return the id of this data source

Returns
std::string representing the id of this data source

Reimplemented in jau::io::ByteInStream_Feed, jau::io::ByteInStream_URL, jau::io::ByteStream_File, and jau::io::ByteStream_Recorder.

Definition at line 241 of file byte_stream.hpp.

◆ hasContentSize()

virtual bool jau::io::ByteStream::hasContentSize ( ) const
pure virtualnoexcept

Returns true if implementation is aware of content_size(), otherwise false.

See also
content_size()

Implemented in jau::io::ByteInStream_Feed, jau::io::ByteInStream_URL, jau::io::ByteStream_File, jau::io::ByteStream_Recorder, and jau::io::ByteStream_SecMemory.

Here is the caller graph for this function:

◆ contentSize()

virtual size_type jau::io::ByteStream::contentSize ( ) const
pure virtualnoexcept

Returns the content_size if known.

See also
has_content_size()

Implemented in jau::io::ByteInStream_Feed, jau::io::ByteInStream_URL, jau::io::ByteStream_File, jau::io::ByteStream_Recorder, and jau::io::ByteStream_SecMemory.

Here is the caller graph for this function:

◆ position()

virtual size_type jau::io::ByteStream::position ( ) const
pure virtualnoexcept

Returns the position indicator, similar to e.g.

std::basic_istream.

Returns
number of bytes read or written so far.

Implemented in jau::io::ByteInStream_Feed, jau::io::ByteInStream_URL, jau::io::ByteStream_File, jau::io::ByteStream_Recorder, and jau::io::ByteStream_SecMemory.

Here is the caller graph for this function:

◆ remaining()

virtual size_type jau::io::ByteStream::remaining ( ) const
inlinevirtualnoexcept

Returns the remaining bytes, i.e.

content_size() - position(), if content_size if known, otherwise zero.

See also
has_content_size()
content_size()
position()

Definition at line 268 of file byte_stream.hpp.

Here is the caller graph for this function:

◆ canRewind()

virtual bool jau::io::ByteStream::canRewind ( ) const
pure virtualnoexcept

Return true if implementation supports random rewinding the stream, i.e.

seek() below position().

If random rewind is not supported and method returns false, one can still rewind in range [mark() .. position()).

See also
seek()
setMark()

Implemented in jau::io::ByteInStream_Feed, jau::io::ByteInStream_URL, jau::io::ByteStream_File, jau::io::ByteStream_Recorder, and jau::io::ByteStream_SecMemory.

◆ seek()

virtual size_type jau::io::ByteStream::seek ( size_type newPos)
nodiscardpure virtualnoexcept

Sets position indicator for output-streams or input-streams with known length, similar to e.g.

std::basic_istream.

No change occurs if fail() was set or the input-stream has no known length.

If newPos is >= stream-length, iostate::eofbit is set and position set to stream-length, otherwise iostate::eofbit is cleared.

Certain implementations may not allow random rewinding of the stream, see canRewind(). In this case, rewinding is limited to mark(), see setMark(), and may return ByteStream::npos if none set or exceeding range.

A ByteInStream's mark is cleared if > newPos.

Parameters
newPosdesired absolute byte-offset (position)
Returns
resulting position if successful (incl eofbit) or ByteStream::npos otherwise having an unchanged position().
See also
canRewind()
setMark()

Implemented in jau::io::ByteInStream_Feed, jau::io::ByteInStream_URL, jau::io::ByteStream_File, jau::io::ByteStream_Recorder, and jau::io::ByteStream_SecMemory.

Here is the caller graph for this function:

◆ toString()

virtual std::string jau::io::ByteStream::toString ( ) const
pure virtualnoexcept

Implemented in jau::io::ByteInStream_Feed, jau::io::ByteInStream_URL, jau::io::ByteStream_File, jau::io::ByteStream_Recorder, and jau::io::ByteStream_SecMemory.

Here is the caller graph for this function:

◆ setMark()

virtual bool jau::io::ByteStream::setMark ( size_type readLimit)
nodiscardpure virtualnoexcept

Set markpos to current position, allowing the stream to be seekMark().

seek() will clear markpos if > newPos.

For implementations where seek() doesn't allow random rewinding of the stream, setMark() will allow rewinding back to markpos if not exceeding readLimit.

Parameters
readlimitmaximum number of bytes able to read before invalidating the markpos.
Returns
true if marks is set successfully, otherwise false
See also
seek()
canRewind()

Implemented in jau::io::ByteInStream_Feed, jau::io::ByteInStream_URL, jau::io::ByteStream_File, jau::io::ByteStream_Recorder, and jau::io::ByteStream_SecMemory.

Here is the caller graph for this function:

◆ mark()

virtual size_type jau::io::ByteStream::mark ( ) const
pure virtualnoexcept

Returns the markpos set via setMark() or ByteStream::npos if unset.

Implemented in jau::io::ByteInStream_Feed, jau::io::ByteInStream_URL, jau::io::ByteStream_File, jau::io::ByteStream_Recorder, and jau::io::ByteStream_SecMemory.

Here is the caller graph for this function:

◆ markReadLimit()

virtual size_type jau::io::ByteStream::markReadLimit ( ) const
pure virtualnoexcept

Returns the readLimit set via setMark().

If unset either 0 or implicit limit.

Implemented in jau::io::ByteInStream_Feed, jau::io::ByteInStream_URL, jau::io::ByteStream_File, jau::io::ByteStream_Recorder, and jau::io::ByteStream_SecMemory.

Here is the caller graph for this function:

◆ seekMark()

virtual bool jau::io::ByteStream::seekMark ( )
nodiscardpure virtualnoexcept

Seeks stream position to markpos as set via setMark().

markpos is kept, hence seekMark() can be called multiple times.

Returns
true if successful (incl eofbit), otherwise false with unchanged position due to I/O failure (iostate::fail set) or setMark() not set.

Implemented in jau::io::ByteInStream_Feed, jau::io::ByteInStream_URL, jau::io::ByteStream_File, jau::io::ByteStream_Recorder, and jau::io::ByteStream_SecMemory.

Here is the caller graph for this function:

◆ available()

virtual bool jau::io::ByteStream::available ( size_t n)
pure virtualnoexcept

Return whether n bytes are available in the input stream, if has_content_size() or using an asynchronous source.

If !has_content_size() and not being an asynchronous source, !end_of_data() is returned.

Method may be blocking when using an asynchronous source up until the requested bytes are available.

A subsequent call to read() shall return immediately with at least the requested numbers of bytes available, if has_content_size() or using an asynchronous source.

See details of the implementing class.

Input stream operation, returns false if !is_input().

Parameters
nbyte count to wait for
Returns
true if n bytes are available, otherwise false
See also
has_content_size()
read()
ByteInStream Properties

Implemented in jau::io::ByteInStream_Feed, jau::io::ByteInStream_URL, jau::io::ByteStream_File, jau::io::ByteStream_Recorder, and jau::io::ByteStream_SecMemory.

Here is the caller graph for this function:

◆ read() [1/2]

virtual size_t jau::io::ByteStream::read ( void * out,
size_t length )
nodiscardpure virtualnoexcept

Read from the source.

Moves the internal offset so that every call to read will return a new portion of the source.

Use available() to try to wait for a certain amount of bytes available.

This method shall only block until min(available, length) bytes are transfered.

See details of the implementing class.

Input stream operation, returns zero if !is_input().

Parameters
outthe byte array to write the result to
lengththe length of the byte array out
Returns
length in bytes that was actually read and put into out
See also
available()
ByteInStream Properties

Implemented in jau::io::ByteInStream_Feed, jau::io::ByteInStream_URL, jau::io::ByteStream_File, jau::io::ByteStream_Recorder, and jau::io::ByteStream_SecMemory.

Here is the caller graph for this function:

◆ read() [2/2]

bool jau::io::ByteStream::read ( uint8_t & bits)
inlinenodiscardnoexcept

Read one byte, uint8_t

Parameters
bitsreference to result
Returns
true if successful, otherwise false

Definition at line 395 of file byte_stream.hpp.

◆ peek() [1/2]

virtual size_t jau::io::ByteStream::peek ( void * out,
size_t length,
size_type peek_offset )
nodiscardpure virtualnoexcept

Read from the source but do not modify the internal offset.

Consecutive calls to peek() will return portions of the source starting at the same position.

Input stream operation, returns zero if !is_input().

Parameters
outthe byte array to write the output to
lengththe length of the byte array out
peek_offsetoffset from current stream position to read at
Returns
length in bytes that was actually read and put into out

Implemented in jau::io::ByteInStream_Feed, jau::io::ByteInStream_URL, jau::io::ByteStream_File, jau::io::ByteStream_Recorder, and jau::io::ByteStream_SecMemory.

Here is the caller graph for this function:

◆ peek() [2/2]

bool jau::io::ByteStream::peek ( uint8_t & out)
inlinenodiscardnoexcept

Peek one byte at current position.

Input stream operation, returns false if !is_input().

Parameters
outan output byte
Returns
true if one byte has been peeked, false otherwise

Definition at line 421 of file byte_stream.hpp.

◆ discard()

virtual size_t jau::io::ByteStream::discard ( size_t N)
nodiscardpure virtualnoexcept

Discard the next N bytes of the data.

Input stream operation, returns zero if !is_input().

Parameters
Nthe number of bytes to discard
Returns
number of bytes actually discarded

Implemented in jau::io::ByteInStream_Feed, jau::io::ByteInStream_URL, jau::io::ByteStream_File, jau::io::ByteStream_Recorder, and jau::io::ByteStream_SecMemory.

Here is the caller graph for this function:

◆ readU16()

bool jau::io::ByteStream::readU16 ( uint16_t & bits)
inlinenodiscardnoexcept

Read uint16_t.

If stream byteOrder() != jau::lb_endian_t::native, result is bytes swapped via jau::bswap().

Parameters
bitsreference to result
Returns
true if successful, otherwise false

Definition at line 442 of file byte_stream.hpp.

Here is the caller graph for this function:

◆ readS16()

bool jau::io::ByteStream::readS16 ( int16_t & bits)
inlinenodiscardnoexcept

Read int16_t.

If stream byteOrder() != jau::lb_endian_t::native, result is bytes swapped via jau::bswap().

Parameters
bitsreference to result
Returns
true if successful, otherwise false

Definition at line 458 of file byte_stream.hpp.

◆ readU32()

bool jau::io::ByteStream::readU32 ( uint32_t & bits)
inlinenodiscardnoexcept

Read incoming uint32_t.

If stream byteOrder() != jau::lb_endian_t::native, result is bytes swapped via jau::bswap().

Parameters
bitsreference to result
Returns
true if successful, otherwise false

Definition at line 467 of file byte_stream.hpp.

Here is the caller graph for this function:

◆ readS32()

bool jau::io::ByteStream::readS32 ( int32_t & bits)
inlinenodiscardnoexcept

Read int32_t.

If stream byteOrder() != jau::lb_endian_t::native, result is bytes swapped via jau::bswap().

Parameters
bitsreference to result
Returns
true if successful, otherwise false

Definition at line 483 of file byte_stream.hpp.

◆ readU64Raw()

bool jau::io::ByteStream::readU64Raw ( uint64_t & bits)
inlinenodiscardnoexcept

Read incoming uint64_t w/o considering bigEndian, i.e.

no byte swap is performed.

Parameters
bitsreference to result
Returns
true if successful, otherwise false

Definition at line 490 of file byte_stream.hpp.

◆ readU64()

bool jau::io::ByteStream::readU64 ( uint64_t & bits)
inlinenodiscardnoexcept

Read incoming uint64_t.

If stream byteOrder() != jau::lb_endian_t::native, result is bytes swapped via jau::bswap().

Parameters
bitsreference to result
Returns
true if successful, otherwise false

Definition at line 503 of file byte_stream.hpp.

Here is the caller graph for this function:

◆ readS64()

bool jau::io::ByteStream::readS64 ( int64_t & bits)
inlinenodiscardnoexcept

Read int64_t.

If stream byteOrder() != jau::lb_endian_t::native, result is bytes swapped via jau::bswap().

Parameters
bitsreference to result
Returns
true if successful, otherwise false

Definition at line 520 of file byte_stream.hpp.

◆ write() [1/2]

virtual size_t jau::io::ByteStream::write ( const void * in,
size_t length )
nodiscardpure virtualnoexcept

Write to the data sink.

Moves the internal offset so that every call to write will be appended to the sink.

This method is not blocking beyond the transfer length bytes.

Output stream operation, returns zero if !is_output().

Parameters
inthe input bytes to write out
lengththe length of the byte array in
Returns
length in bytes that were actually written

Implemented in jau::io::ByteInStream_Feed, jau::io::ByteInStream_URL, jau::io::ByteStream_File, jau::io::ByteStream_Recorder, and jau::io::ByteStream_SecMemory.

Here is the caller graph for this function:

◆ write() [2/2]

bool jau::io::ByteStream::write ( uint8_t in)
inlinenodiscardnoexcept

Write one byte, uint8_t.

Output stream operation, returns false if !is_output().

Parameters
inthe byte to be written
Returns
true if one byte has been written, otherwise false

Definition at line 548 of file byte_stream.hpp.

◆ flush()

virtual void jau::io::ByteStream::flush ( )
pure virtualnoexcept

◆ writeU16()

bool jau::io::ByteStream::writeU16 ( uint16_t bits)
inlinenodiscardnoexcept

Write the given uint16_t.

If stream byteOrder() != jau::lb_endian_t::native, result is bytes swapped via jau::bswap().

Parameters
bitsdata to write
Returns
true if successful, otherwise false

Definition at line 565 of file byte_stream.hpp.

Here is the caller graph for this function:

◆ writeS16()

bool jau::io::ByteStream::writeS16 ( int16_t bits)
inlinenodiscardnoexcept

Write the given int16_t.

If stream byteOrder() != jau::lb_endian_t::native, result is bytes swapped via jau::bswap().

Parameters
bitsdata to write
Returns
true if successful, otherwise false

Definition at line 579 of file byte_stream.hpp.

◆ writeU32()

bool jau::io::ByteStream::writeU32 ( uint32_t bits)
inlinenodiscardnoexcept

Write the given uint32_t.

If stream byteOrder() != jau::lb_endian_t::native, result is bytes swapped via jau::bswap().

Parameters
bitsdata to write
Returns
true if successful, otherwise false

Definition at line 589 of file byte_stream.hpp.

Here is the caller graph for this function:

◆ writeS32()

bool jau::io::ByteStream::writeS32 ( int32_t bits)
inlinenodiscardnoexcept

Write the given int32_t.

If stream byteOrder() != jau::lb_endian_t::native, result is bytes swapped via jau::bswap().

Parameters
bitsdata to write
Returns
true if successful, otherwise false

Definition at line 603 of file byte_stream.hpp.

◆ writeU64Raw()

bool jau::io::ByteStream::writeU64Raw ( uint64_t bits)
inlinenodiscardnoexcept

Write the given uint64_t w/o considering bigEndian, i.e.

no byte swap is performed.

Parameters
bitsdata to write
Returns
true if successful, otherwise false

Definition at line 611 of file byte_stream.hpp.

◆ writeU64()

bool jau::io::ByteStream::writeU64 ( uint64_t bits)
inlinenodiscardnoexcept

Write the given uint64_t.

If stream byteOrder() != jau::lb_endian_t::native, result is bytes swapped via jau::bswap().

Parameters
bitsdata to write
Returns
true if successful, otherwise false

Definition at line 622 of file byte_stream.hpp.

Here is the caller graph for this function:

◆ writeS64()

bool jau::io::ByteStream::writeS64 ( int64_t bits)
inlinenodiscardnoexcept

Write the given int64_t.

If stream byteOrder() != jau::lb_endian_t::native, result is bytes swapped via jau::bswap().

Parameters
bitsdata to write
Returns
true if successful, otherwise false

Definition at line 636 of file byte_stream.hpp.

Member Data Documentation

◆ m_iomode

iomode_t jau::io::ByteStream::m_iomode
protected

Definition at line 191 of file byte_stream.hpp.

◆ m_byteOrder

lb_endian_t jau::io::ByteStream::m_byteOrder
protected

Definition at line 192 of file byte_stream.hpp.

◆ npos

size_type jau::io::ByteStream::npos = std::numeric_limits<size_type>::max()
staticconstexpr

Invalid position constant, denoting unset mark() or invalid position.

Value: std::numeric_limits<size_type>::max()

Definition at line 199 of file byte_stream.hpp.


The documentation for this class was generated from the following files: