88 * certain length.
99 */
1010class ZipFileInputStream implements InputStream {
11- protected
12- $ reader = null ,
13- $ start = 0 ,
14- $ pos = 0 ,
15- $ length = 0 ;
11+ protected $ reader , $ start , $ length ;
12+ protected $ pos = 0 ;
1613
1714 /**
1815 * Constructor
1916 *
20- * @param io.archive.zip.AbstractZipReaderImpl reader
21- * @param int start
22- * @param int length
17+ * @param io.archive.zip.AbstractZipReaderImpl $ reader
18+ * @param int $ start
19+ * @param int $ length
2320 */
2421 public function __construct (AbstractZipReaderImpl $ reader , $ start , $ length ) {
2522 $ this ->reader = $ reader ;
@@ -30,16 +27,18 @@ public function __construct(AbstractZipReaderImpl $reader, $start, $length) {
3027 /**
3128 * Read a string
3229 *
33- * @param int limit default 8192
34- * @return string
30+ * @param int $limit default 8192
31+ * @return string
32+ * @throws io.IOException on EOF
3533 */
3634 public function read ($ limit = 8192 ) {
3735 if (0 === $ this ->pos ) {
3836 $ this ->reader ->streamPosition ($ this ->start );
3937 } else if ($ this ->pos >= $ this ->length ) {
4038 throw new IOException ('EOF ' );
4139 }
42- $ chunk = $ this ->reader ->streamRead (min ($ limit , $ this ->length - $ this ->pos ));
40+
41+ $ chunk = $ this ->reader ->streamRead (min ($ limit , $ this ->length - $ this ->pos ));
4342 $ l = strlen ($ chunk );
4443 $ this ->pos += $ l ;
4544 $ this ->reader ->skip -= $ l ;
@@ -50,6 +49,7 @@ public function read($limit= 8192) {
5049 * Returns the number of bytes that can be read from this stream
5150 * without blocking.
5251 *
52+ * @return int
5353 */
5454 public function available () {
5555 return $ this ->pos < $ this ->length ? $ this ->reader ->streamAvailable () : 0 ;
@@ -58,6 +58,7 @@ public function available() {
5858 /**
5959 * Close this buffer
6060 *
61+ * @return void
6162 */
6263 public function close () {
6364 // NOOP, leave underlying stream open
0 commit comments