Overview

Namespaces

  • Docta
    • MercadoLibre
      • Exception
      • OAuth2
        • Client
          • Test
  • GuzzleHttp
    • Cookie
    • Exception
    • Handler
    • Promise
      • Test
      • Tests
    • Psr7
    • Test
      • Handler
    • Tests
      • CookieJar
      • Event
      • Exception
      • Handler
      • Promise
      • Psr7
  • League
    • OAuth2
      • Client
        • Grant
          • Exception
        • Provider
          • Exception
        • Test
          • Grant
          • Provider
            • Exception
            • Fake
          • Token
          • Tool
        • Token
        • Tool
  • None
  • Psr
    • Http
      • Message

Classes

  • AppendStream
  • BufferStream
  • CachingStream
  • DroppingStream
  • FnStream
  • InflateStream
  • LazyOpenStream
  • LimitStream
  • MultipartStream
  • NoSeekStream
  • PumpStream
  • Request
  • Response
  • ServerRequest
  • Stream
  • StreamWrapper
  • UploadedFile
  • Uri
  • UriNormalizer
  • UriResolver

Traits

  • MessageTrait
  • StreamDecoratorTrait

Functions

  • build_query
  • copy_to_stream
  • copy_to_string
  • fread
  • hash
  • mimetype_from_extension
  • mimetype_from_filename
  • modify_request
  • normalize_header
  • parse_header
  • parse_query
  • parse_request
  • parse_response
  • readline
  • rewind_body
  • str
  • stream_for
  • try_fopen
  • uri_for
  • Overview
  • Namespace
  • Class
  • Download

Class LimitStream

Decorator used to return only a subset of a stream

GuzzleHttp\Psr7\LimitStream implements Psr\Http\Message\StreamInterface uses GuzzleHttp\Psr7\StreamDecoratorTrait
Namespace: GuzzleHttp\Psr7
Located at src/LimitStream.php
Methods summary
public
# __construct( Psr\Http\Message\StreamInterface $stream, integer $limit = -1, integer $offset = 0 )

Parameters

$stream
Stream to wrap
$limit

Total number of bytes to allow to be read from the stream. Pass -1 for no limit.

$offset

Position to seek to before reading (only works on seekable streams).

public boolean
# eof( )

Returns true if the stream is at the end of the stream.

Returns true if the stream is at the end of the stream.

Returns

boolean

Implementation of

Psr\Http\Message\StreamInterface::eof()
public integer|null
# getSize( )

Returns the size of the limited subset of data Get the size of the stream if known.

Returns the size of the limited subset of data Get the size of the stream if known.

Returns

integer|null
Returns the size in bytes if known, or null if unknown.

Implementation of

Psr\Http\Message\StreamInterface::getSize()
public
# seek( integer $offset, integer $whence = SEEK_SET )

Allow for a bounded seek on the read limited stream Seek to a position in the stream.

Allow for a bounded seek on the read limited stream Seek to a position in the stream.

Parameters

$offset
Stream offset
$whence

Specifies how the cursor position will be calculated based on the seek offset. Valid values are identical to the built-in PHP $whence values for fseek(). SEEK_SET: Set position equal to offset bytes SEEK_CUR: Set position to current location plus offset SEEK_END: Set position to end-of-stream plus offset.

Throws

RuntimeException
on failure.

Implementation of

Psr\Http\Message\StreamInterface::seek()
public integer
# tell( )

Give a relative tell() Returns the current position of the file read/write pointer

Give a relative tell() Returns the current position of the file read/write pointer

Returns

integer
Position of the file pointer

Throws

RuntimeException
on error.

Implementation of

Psr\Http\Message\StreamInterface::tell()
public
# setOffset( integer $offset )

Set the offset to start limiting from

Set the offset to start limiting from

Parameters

$offset
Offset to seek to and begin byte limiting from

Throws

RuntimeException
if the stream cannot be seeked.
public
# setLimit( integer $limit )

Set the limit of bytes that the decorator allows to be read from the stream.

Set the limit of bytes that the decorator allows to be read from the stream.

Parameters

$limit

Number of bytes to allow to be read from the stream. Use -1 for no limit.

public string
# read( integer $length )

Read data from the stream.

Read data from the stream.

Parameters

$length

Read up to $length bytes from the object and return them. Fewer than $length bytes may be returned if underlying stream call returns fewer bytes.

Returns

string

Returns the data read from the stream, or an empty string if no bytes are available.

Throws

RuntimeException
if an error occurs.

Implementation of

Psr\Http\Message\StreamInterface::read()
Methods inherited from Psr\Http\Message\StreamInterface
__toString(), close(), detach(), getContents(), getMetadata(), isReadable(), isSeekable(), isWritable(), rewind(), write()
Methods used from GuzzleHttp\Psr7\StreamDecoratorTrait
__call(), __get(), __toString(), close(), createStream(), detach(), getContents(), getMetadata(), isReadable(), isSeekable(), isWritable(), rewind(), write()
MercadoLibre PHP SDK API documentation generated by ApiGen