PHP 클래스 Protobuf\Stream

저자: Fabio B. Silva ([email protected])
파일 보기 프로젝트 열기: protobuf-php/protobuf 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( resource $stream, integer $size = null )
__destruct ( ) Closes the stream when the destructed
__toString ( )
create ( ) : Stream Create a new stream.
eof ( ) : boolean Returns true if the stream is at the end of the stream.
fromString ( string $resource = '', integer $size = null ) : Stream Create a new stream from a string.
getContents ( ) : string Returns the remaining contents of the stream as a string.
getSize ( ) : integer | null Get the size of the stream
read ( integer $length ) : string Read data from the stream
readStream ( integer $length ) : Stream Read stream
seek ( integer $offset, integer $whence = SEEK_SET ) Seek to a position in the stream
tell ( ) : integer Returns the current position of the file read/write pointer
wrap ( Stream | resource | string $resource = '', integer $size = null ) : Stream Wrap the input resource in a stream object.
write ( string $bytes, integer $length ) : integer Write data to the stream
writeStream ( Stream $stream, integer $length ) : integer Write stream

메소드 상세

__construct() 공개 메소드

public __construct ( resource $stream, integer $size = null )
$stream resource
$size integer

__destruct() 공개 메소드

Closes the stream when the destructed
public __destruct ( )

__toString() 공개 메소드

public __toString ( )

create() 공개 정적인 메소드

Create a new stream.
public static create ( ) : Stream
리턴 Stream

eof() 공개 메소드

Returns true if the stream is at the end of the stream.
public eof ( ) : boolean
리턴 boolean

fromString() 공개 정적인 메소드

Create a new stream from a string.
public static fromString ( string $resource = '', integer $size = null ) : Stream
$resource string
$size integer
리턴 Stream

getContents() 공개 메소드

Returns the remaining contents of the stream as a string.
public getContents ( ) : string
리턴 string

getSize() 공개 메소드

Get the size of the stream
public getSize ( ) : integer | null
리턴 integer | null Returns the size in bytes if known

read() 공개 메소드

Read data from the stream
public read ( integer $length ) : string
$length integer
리턴 string

readStream() 공개 메소드

Read stream
public readStream ( integer $length ) : Stream
$length integer
리턴 Stream

seek() 공개 메소드

Seek to a position in the stream
public seek ( integer $offset, integer $whence = SEEK_SET )
$offset integer
$whence integer

tell() 공개 메소드

Returns the current position of the file read/write pointer
public tell ( ) : integer
리턴 integer

wrap() 공개 정적인 메소드

Wrap the input resource in a stream object.
public static wrap ( Stream | resource | string $resource = '', integer $size = null ) : Stream
$resource Stream | resource | string
$size integer
리턴 Stream

write() 공개 메소드

Write data to the stream
public write ( string $bytes, integer $length ) : integer
$bytes string
$length integer
리턴 integer

writeStream() 공개 메소드

Write stream
public writeStream ( Stream $stream, integer $length ) : integer
$stream Stream
$length integer
리턴 integer