Synalyze It!  1.10
Public Member Functions | List of all members
ByteView Class Reference

The ByteView class. More...

Public Member Functions

 ByteView (ByteArray byteArray)
 Constructor of ByteView. More...
 
ByteArray getByteArray ()
 Get underlying byte array of byte view. More...
 
long getLength ()
 Get length of byte view. More...
 
long findByteSequence (long startPos, long length, buffer, size_t bufferLength)
 Find byte sequence. More...
 
byte readByte (long position)
 Read byte from byte view (position in bytes) More...
 
int readSignedInt (long position, int length, ENDIAN_TYPE endianType)
 Read signed integer from byte view. More...
 
int readSignedIntBits (long position, int length, ENDIAN_TYPE endianType)
 Read signed integer at bit position from byte view. Little endian numbers longer than one byte are treated left aligned, big endian numbers right aligned. More...
 
uint readUnsignedInt (long position, int length, ENDIAN_TYPE endianType)
 Read unsigned integer from byte view. More...
 
uint readUnsignedIntBits (long position, int length, ENDIAN_TYPE endianType)
 Read unsigned integer at bit position from byte view. Little endian numbers longer than one byte are treated left aligned, big endian numbers right aligned. More...
 
String readString (long position, int length, String encoding)
 Read string from byte view. More...
 

Detailed Description

The ByteView class.

A byte view object is a proxy to a ByteArray object.

Author
Andreas Pehnack
Date
2009-12-12

Constructor & Destructor Documentation

◆ ByteView()

ByteView ( ByteArray  byteArray)

Constructor of ByteView.

Author
Andreas Pehnack
Date
2011-09-01
Parameters
[in]byteArrayByte array to create byte view for
Returns
New byte view

Member Function Documentation

◆ findByteSequence()

long findByteSequence ( long  startPos,
long  length,
buffer  ,
size_t  bufferLength 
)

Find byte sequence.

Author
Andreas Pehnack
Date
2015-10-26
Returns
Position where byte sequence was found, otherwise -1

◆ getByteArray()

ByteArray getByteArray ( )

Get underlying byte array of byte view.

Author
Andreas Pehnack
Date
2015-12-02
Returns
Byte array of byte view

◆ getLength()

long getLength ( )

Get length of byte view.

Author
Andreas Pehnack
Date
2011-09-01
Returns
Length of byte view

◆ readByte()

byte readByte ( long  position)

Read byte from byte view (position in bytes)

Author
Andreas Pehnack
Date
2009-12-12
Parameters
[in]positionPosition where to read the byte
Returns
Byte at position
See also
readSignedInt()
readUnsignedInt()

◆ readSignedInt()

int readSignedInt ( long  position,
int  length,
ENDIAN_TYPE  endianType 
)

Read signed integer from byte view.

Author
Andreas Pehnack
Date
2009-12-12
Parameters
[in]positionPosition where to read the number
[in]lengthLength of the number in bytes
[in]endianTypeLittle/big endian
Returns
Signed int at position
See also
readByte()
readUnsignedInt()

◆ readSignedIntBits()

int readSignedIntBits ( long  position,
int  length,
ENDIAN_TYPE  endianType 
)

Read signed integer at bit position from byte view. Little endian numbers longer than one byte are treated left aligned, big endian numbers right aligned.

Author
Andreas Pehnack
Date
2009-12-12
Parameters
[in]positionBit position where to read the number
[in]lengthLength of the number in bits
[in]endianTypeLittle/big endian
Returns
Unsigned int at bit position
See also
readByte()
readUnsignedInt()

◆ readString()

String readString ( long  position,
int  length,
String  encoding 
)

Read string from byte view.

Author
Andreas Pehnack
Date
2009-12-12
Parameters
[in]positionPosition where to read the string
[in]lengthLength of the string in bytes
[in]encodingEncoding of the string
Returns
String at position
See also
readByte()
readSignedInt()
readUnsignedInt()

◆ readUnsignedInt()

uint readUnsignedInt ( long  position,
int  length,
ENDIAN_TYPE  endianType 
)

Read unsigned integer from byte view.

Author
Andreas Pehnack
Date
2009-12-12
Parameters
[in]positionPosition where to read the number
[in]lengthLength of the number in bytes
[in]endianTypeLittle/big endian
Returns
Unsigned int at position
See also
readByte()
readSignedInt()

◆ readUnsignedIntBits()

uint readUnsignedIntBits ( long  position,
int  length,
ENDIAN_TYPE  endianType 
)

Read unsigned integer at bit position from byte view. Little endian numbers longer than one byte are treated left aligned, big endian numbers right aligned.

Author
Andreas Pehnack
Date
2009-12-12
Parameters
[in]positionBit position where to read the number
[in]lengthLength of the number in bits
[in]endianTypeLittle/big endian
Returns
Unsigned int at bit position
See also
readByte()
readUnsignedInt()

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