IO Stream classes mimicking java.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[Deprecated]Stream\StandardOutputStream[Deprecated]
- Stream\Exception\IOException
- Stream\Exception\FileNotFoundException
- This project is experimental and does not guarantee the same functionality as java.io.
- Some features may be unstable due to mimicking method overloading with optional parameters.
- PHP >= 8.3
- jetbrains/phpstorm-attributes >= 1.0
composer require antibiotics11/stream:dev-main