\PhpOffice\PhpSpreadsheet\Writer\XlsBIFFwriter

Summary

Methods
Properties
Constants
__construct()
getByteOrder()
writeData()
writeEof()
$_data
$_datasize
No constants found
append()
storeBof()
storeEof()
No protected properties found
N/A
addContinue()
$byteOrder
$limit
N/A

Properties

$_data

$_data : string

The string containing the data of the BIFF stream.

Type

string

$_datasize

$_datasize : int

The size of the data in bytes. Should be the same as strlen($this->_data).

Type

int

$byteOrder

$byteOrder : int

The byte order of this architecture. 0 => little endian, 1 => big endian.

Type

int

$limit

$limit : int

The maximum length for a BIFF record (excluding record header and length field). See addContinue().

Type

int

Methods

__construct()

__construct() : mixed

Constructor.

Returns

mixed —

getByteOrder()

getByteOrder() : int

Determine the byte order and store it as class data to avoid recalculating it for each call to new().

Returns

int —

writeData()

writeData(string  $data) : string

General storage function like append, but returns string instead of modifying $this->_data.

Parameters

string $data

binary data to write

Returns

string —

writeEof()

writeEof() : mixed

Writes Excel EOF record to indicate the end of a BIFF stream.

Returns

mixed —

append()

append(string  $data) : void

General storage function.

Parameters

string $data

binary data to append

storeBof()

storeBof(int  $type) : void

Writes Excel BOF record to indicate the beginning of a stream or sub-stream in the BIFF file.

Parameters

int $type

type of BIFF file to write: 0x0005 Workbook, 0x0010 Worksheet

storeEof()

storeEof() : void

Writes Excel EOF record to indicate the end of a BIFF stream.

addContinue()

addContinue(string  $data) : string

Excel limits the size of BIFF records. In Excel 5 the limit is 2084 bytes. In Excel 97 the limit is 8228 bytes. Records that are longer than these limits must be split up into CONTINUE blocks.

This function takes a long BIFF record and inserts CONTINUE records as necessary.

Parameters

string $data

The original binary data to be written

Returns

string —

A very convenient string of continue blocks