class LazyBodyPartStream implements StreamInterface (View source)

Properties

protected int $position

The current position in the stream.

protected string|null $content

The cached content.

Methods

__construct(Message $message, BodyStructurePart $part)

Constructor.

string
__toString()

{@inheritDoc}

void
close()

{@inheritDoc}

detach()

{@inheritDoc}

int|null
getSize()

{@inheritDoc}

int
tell()

{@inheritDoc}

bool
eof()

{@inheritDoc}

bool
isSeekable()

{@inheritDoc}

void
seek(int $offset, int $whence = SEEK_SET)

{@inheritDoc}

void
rewind()

{@inheritDoc}

bool
isWritable()

{@inheritDoc}

bool
isReadable()

{@inheritDoc}

string
read(int $length)

{@inheritDoc}

string
getContents()

{@inheritDoc}

array|null
getMetadata(string|null $key = null)

{@inheritDoc}

int
write(string $string)

{@inheritDoc}

string
getOrFetchContent()

Fetch the content from the server if not already cached.

Details

__construct(Message $message, BodyStructurePart $part)

Constructor.

Parameters

Message $message
BodyStructurePart $part

string __toString()

{@inheritDoc}

Return Value

string

void close()

{@inheritDoc}

Return Value

void

detach()

{@inheritDoc}

int|null getSize()

{@inheritDoc}

Return Value

int|null

int tell()

{@inheritDoc}

Return Value

int

bool eof()

{@inheritDoc}

Return Value

bool

bool isSeekable()

{@inheritDoc}

Return Value

bool

void seek(int $offset, int $whence = SEEK_SET)

{@inheritDoc}

Parameters

int $offset
int $whence

Return Value

void

void rewind()

{@inheritDoc}

Return Value

void

bool isWritable()

{@inheritDoc}

Return Value

bool

bool isReadable()

{@inheritDoc}

Return Value

bool

string read(int $length)

{@inheritDoc}

Parameters

int $length

Return Value

string

string getContents()

{@inheritDoc}

Return Value

string

array|null getMetadata(string|null $key = null)

{@inheritDoc}

Parameters

string|null $key

Return Value

array|null

int write(string $string)

{@inheritDoc}

Parameters

string $string

Return Value

int

protected string getOrFetchContent()

Fetch the content from the server if not already cached.

Return Value

string