phpbotgram

BufferedInputFile extends InputFile
in package

FinalYes

Standalone abstract — InputFile is intentionally NOT a TelegramObject. Upstream aiogram declares `class InputFile(ABC)` (aiogram/types/input_file.py); attaching it to the TelegramObject tree would make it eligible for Serializer dump/load, which is wrong: InputFile values are detached by `BaseSession::prepareValue` into the multipart `$files` channel and never go through JSON.

Table of Contents

Constants

DEFAULT_CHUNK_SIZE  : int = 65536

Properties

$chunkSize  : int
$data  : string
$filename  : string|null

Methods

__construct()  : mixed
fromFile()  : self
read()  : ReadableStream
Returns a Fiber-aware readable stream of file bytes.

Constants

DEFAULT_CHUNK_SIZE

public int DEFAULT_CHUNK_SIZE = 65536

Properties

$chunkSize read-only

public int $chunkSize = self::DEFAULT_CHUNK_SIZE

$filename read-only

public string|null $filename = null

Methods

__construct()

public __construct(string $data, string $filename[, int $chunkSize = self::DEFAULT_CHUNK_SIZE ]) : mixed
Parameters
$data : string
$filename : string
$chunkSize : int = self::DEFAULT_CHUNK_SIZE

fromFile()

public static fromFile(string $path[, string|null $filename = null ][, int $chunkSize = self::DEFAULT_CHUNK_SIZE ]) : self
Parameters
$path : string
$filename : string|null = null
$chunkSize : int = self::DEFAULT_CHUNK_SIZE
Return values
self

read()

Returns a Fiber-aware readable stream of file bytes.

public read(Bot $bot) : ReadableStream
Parameters
$bot : Bot
Return values
ReadableStream
On this page

Search results