Skip to content

Commit c93173f

Browse files
committed
update some for file
1 parent e902c97 commit c93173f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/File.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,20 @@ public static function streamReadAll($stream, int $length = -1, int $offset = -1
366366
return (string)stream_get_contents($stream, $length, $offset);
367367
}
368368

369+
/**
370+
* Read one char from stream.
371+
*
372+
* @param $stream
373+
*
374+
* @return string
375+
*/
376+
public static function streamReadChar($stream): string
377+
{
378+
self::assertReadableStream($stream);
379+
380+
return (string)stream_get_contents($stream, 1);
381+
}
382+
369383
/**
370384
* Retrieves header/meta data from streams/file pointers
371385
*

0 commit comments

Comments
 (0)