PHP 클래스 Swift_ByteStream_ArrayByteStream, Halite

저자: Chris Corbyn
상속: implements Swift_InputByteStream, implements Swift_OutputByteStream
파일 보기 프로젝트 열기: HaliteChallenge/Halite 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( mixed $stack = null ) Create a new ArrayByteStream.
bind ( Swift_InputByteStream $is ) Attach $is to this stream.
commit ( ) Not used.
flushBuffers ( ) Flush the contents of the stream (empty it) and set the internal pointer to the beginning.
read ( integer $length ) : string Reads $length bytes from the stream into a string and moves the pointer through the stream by $length.
setReadPointer ( integer $byteOffset ) : boolean Move the internal read pointer to $byteOffset in the stream.
unbind ( Swift_InputByteStream $is ) Remove an already bound stream.
write ( string $bytes ) Writes $bytes to the end of the stream.

메소드 상세

__construct() 공개 메소드

If $stack is given the stream will be populated with the bytes it contains.
public __construct ( mixed $stack = null )
$stack mixed of bytes in string or array form, optional

bind() 공개 메소드

The stream acts as an observer, receiving all data that is written. All {@link write()} and {@link flushBuffers()} operations will be mirrored.
public bind ( Swift_InputByteStream $is )
$is Swift_InputByteStream

commit() 공개 메소드

Not used.
public commit ( )

flushBuffers() 공개 메소드

Flush the contents of the stream (empty it) and set the internal pointer to the beginning.
public flushBuffers ( )

read() 공개 메소드

If less bytes exist than are requested the remaining bytes are given instead. If no bytes are remaining at all, boolean false is returned.
public read ( integer $length ) : string
$length integer
리턴 string

setReadPointer() 공개 메소드

Move the internal read pointer to $byteOffset in the stream.
public setReadPointer ( integer $byteOffset ) : boolean
$byteOffset integer
리턴 boolean

unbind() 공개 메소드

If $is is not bound, no errors will be raised. If the stream currently has any buffered data it will be written to $is before unbinding occurs.
public unbind ( Swift_InputByteStream $is )
$is Swift_InputByteStream

write() 공개 메소드

Writes $bytes to the end of the stream.
public write ( string $bytes )
$bytes string