antibiotics11 / stream
模拟java.io的IO流类
dev-main
2024-06-08 13:14 UTC
Requires
- php: >=8.3.0
Requires (Dev)
This package is auto-updated.
Last update: 2024-09-08 13:46:59 UTC
README
模拟java.io的IO流类
use antibiotics11\Stream\FileOutputStream; $helloWorldFile = new FileOutputStream(name: "hello_world.txt", append: true); for ($i = 0; $i < 10; $i++) { $helloWorldFile->write(bytes: "Hello, World!\r\n"); } $helloWorldFile->flush(); $helloWorldFile->close();
类
- Stream\InputStream
- Stream\OutputStream
- Stream\FileInputStream
- Stream\FileOutputStream
- Stream\BufferedOutputStream
Stream\StandardInputStream[已弃用]Stream\StandardOutputStream[已弃用]
异常
- Stream\Exception\IOException
- Stream\Exception\FileNotFoundException
注意
- 该项目是实验性的,不能保证与java.io具有相同的功能。
- 由于模仿带有可选参数的重载方法,一些功能可能不稳定。
要求
- PHP >= 8.3
- jetbrains/phpstorm-attributes >= 1.0
安装
composer require antibiotics11/stream:dev-main