DFDL4S (DFDL for Space Library)
Public Member Functions | List of all members
org.esa.s2g.dfdllib.DataSize Class Reference

Public Member Functions

 DataSize (long nrBytes, int nrBits)
 
String toString ()
 
long getNrBytesTotal ()
 
long getNrFullReservedBytes ()
 
int getNrBitsOfTheLastByte ()
 
long getNrBitsTotal ()
 
boolean isEqualTo (DataSize other)
 
boolean isGreaterThan (DataSize other)
 
boolean isLessThan (DataSize other)
 
void accumulate (long nrBytes, int nrBits)
 

Detailed Description

The class DataSize represents the size of a data block. It provided byte and bit reference.

Constructor & Destructor Documentation

◆ DataSize()

org.esa.s2g.dfdllib.DataSize.DataSize ( long  nrBytes,
int  nrBits 
)

The constructor that allow the user create a new DataSize object with the given number of bytes and bits

Parameters
nrBytesthe initial number of bytes
nrBitsthe initial number of bits

Member Function Documentation

◆ accumulate()

void org.esa.s2g.dfdllib.DataSize.accumulate ( long  nrBytes,
int  nrBits 
)

Accumulate this size object with another size object

Parameters
nrBytesthe size in bytes to be added
nrBitsthe size in bits to be added

◆ getNrBitsOfTheLastByte()

int org.esa.s2g.dfdllib.DataSize.getNrBitsOfTheLastByte ( )

Access the number of bits of the last byte reserved for the element

e.g. For DataSize object containing 1 byte and 2 bit the return value will be 2

Returns
the number of bits

◆ getNrBitsTotal()

long org.esa.s2g.dfdllib.DataSize.getNrBitsTotal ( )

Access the total number of bits covering the data of this size

e.g. For DataSize object containing 1 byte and 2 bit the return value will be 10 (1*8 + 2)

Returns
the number of bits

◆ getNrBytesTotal()

long org.esa.s2g.dfdllib.DataSize.getNrBytesTotal ( )

Get the number of bytes necessary to store a block of data of size this.

e.g. For DataSize object containing 1 byte and 2 bit the return value will be 2 (1 byte + 1 byte for the 2 bits)

Returns
the number of bytes

◆ getNrFullReservedBytes()

long org.esa.s2g.dfdllib.DataSize.getNrFullReservedBytes ( )

Get the number of full reserved bytes of the element

e.g. For DataSize object containing 1 byte and 2 bit the return value will be 1

Returns
the number of bytes

◆ isEqualTo()

boolean org.esa.s2g.dfdllib.DataSize.isEqualTo ( DataSize  other)

Checks if this object equals another size instance

Parameters
otherthe size instance to use for comparison
Returns
true if both instances represent the same size value; false otherwise

◆ isGreaterThan()

boolean org.esa.s2g.dfdllib.DataSize.isGreaterThan ( DataSize  other)

Checks if this object is greater than another size instance

Parameters
otherthe size instance to use for comparison
Returns
true if this represents a greater size value; false otherwise

◆ isLessThan()

boolean org.esa.s2g.dfdllib.DataSize.isLessThan ( DataSize  other)

Checks if this object is less than another size instance

Parameters
otherthe size instance to use for comparison
Returns
true if this represents a lesser size value; false otherwise

◆ toString()

String org.esa.s2g.dfdllib.DataSize.toString ( )

Generate the textual representation of size

Returns
the textual representation of size

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