setasign\SetaPDF2\Core\Reader

BinaryReader Class representing a binary reader

File: /SetaPDF v2/Core/Reader/BinaryReader.php
Old class name (alias): \SetaPDF_Core_Reader_Binary

Class hierarchy

Summary

Constants

BYTE_ORDER_BIG_ENDIAN

public const string BinaryReader::BYTE_ORDER_BIG_ENDIAN = 'bigEndian'

Big endian byte order

BYTE_ORDER_LITTLE_ENDIAN

public const string BinaryReader::BYTE_ORDER_LITTLE_ENDIAN = 'littleEndian'

Little endian byte order


Properties

$_reader

The main reader instance


Methods

__construct()

cleanUp()

public BinaryReader::cleanUp (
void
): void

Release resources/cycled references.

getReader()

readByte()

public BinaryReader::readByte (
int $pos = null
): string|bool

Read a single byte.

Parameters
$pos : int
 

readBytes()

public BinaryReader::readBytes (
int $length,
int $pos = null
): string|bool

Read a specific amount of bytes.

Parameters
$length : int
 
$pos : int
 

readInt16()

public BinaryReader::readInt16 (
?int $pos = null,
string $byteOrder = BinaryReader::BYTE_ORDER_BIG_ENDIAN
): int

Reads a 16-bit signed integer.

Parameters
$pos : ?int
 
$byteOrder : string
 

readInt32()

public BinaryReader::readInt32 (
?int $pos = null,
string $byteOrder = BinaryReader::BYTE_ORDER_BIG_ENDIAN
): mixed

Reads a 32-bit signed integer.

Parameters
$pos : ?int
 
$byteOrder : string
 

readInt8()

public BinaryReader::readInt8 (
?int $pos = null
): int

Reads a 8-bit/1-byte signed integer.

Parameters
$pos : ?int
 

readUInt16()

public BinaryReader::readUInt16 (
?int $pos = null,
string $byteOrder = BinaryReader::BYTE_ORDER_BIG_ENDIAN
): int

Reads a 16-bit unsigned integer.

Parameters
$pos : ?int
 
$byteOrder : string
 

readUInt32()

public BinaryReader::readUInt32 (
?int $pos = null,
string $byteOrder = BinaryReader::BYTE_ORDER_BIG_ENDIAN
): mixed

Reads a 32-bit unsigned integer.

Parameters
$pos : ?int
 
$byteOrder : string
 

readUInt8()

public BinaryReader::readUInt8 (
?int $pos = null
): int

Reads a 8-bit/1-byte unsigned integer.

Parameters
$pos : ?int
 

reset()

public BinaryReader::reset (
int $position,
int $length
): void

Reset the reader to a specific position.

Parameters
$position : int
 
$length : int
 

seek()

public BinaryReader::seek (
int $position
): void

Seek to a position.

Parameters
$position : int
 

skip()

public BinaryReader::skip (
int $length
): void

Skip a specific byte count.

Parameters
$length : int