meekframework/stream
Composer 安装命令:
composer require meekframework/stream
包简介
README 文档
README
A set of interfaces for working with streams, as well as an in-memory implementation.
Installation
With Composer:
composer require meekframework/stream
Usage
Using the interfaces:
// write to stdout... class CliOutput implements Meek\Stream\Writable { public function write(string $data): int { // implementation here... } } // read from stdin... class CliInput implements Meek\Stream\Readable, Meek\Stream\Seekable { // implement methods from contracts... }
Using the in-memory Buffer class:
$stream = new Buffer('hello'); $stream->read(2); // returns 'he' $stream->getContents(); // returns 'llo' $stream->write(' world'); $stream->rewind(); $stream->getContents(); // returns 'hello world'
Interfaces
- Duplex
- Lockable
- Readable
- Seekable
- Transform
- Writable
Contributing
See CONTRIBUTING.md.
Credits/Authors
License
The MIT License (MIT). Please see LICENSE.md for more information.
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-06-30