PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 5.5.1
Defender Security – Malware Scanner, Login Security & Firewall v5.5.1
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
defender-security / vendor / thecodingmachine / safe / generated / bzip2.php

bzip2.php in Defender Security – Malware Scanner, Login Security & Firewall 5.5.1, at vendor/thecodingmachine/safe/generated/bzip2.php

97 lines 2.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Safe;
4
5 use Safe\Exceptions\Bzip2Exception;
6
7 /**
8 * Closes the given bzip2 file pointer.
9 *
10 * @param resource $bz The file pointer. It must be valid and must point to a file
11 * successfully opened by bzopen.
12 * @throws Bzip2Exception
13 *
14 */
15 function bzclose($bz): void
16 {
17 error_clear_last();
18 $result = \bzclose($bz);
19 if ($result === false) {
20 throw Bzip2Exception::createFromPhpError();
21 }
22 }
23
24
25 /**
26 * Forces a write of all buffered bzip2 data for the file pointer
27 * bz.
28 *
29 * @param resource $bz The file pointer. It must be valid and must point to a file
30 * successfully opened by bzopen.
31 * @throws Bzip2Exception
32 *
33 */
34 function bzflush($bz): void
35 {
36 error_clear_last();
37 $result = \bzflush($bz);
38 if ($result === false) {
39 throw Bzip2Exception::createFromPhpError();
40 }
41 }
42
43
44 /**
45 * bzread reads from the given bzip2 file pointer.
46 *
47 * Reading stops when length (uncompressed) bytes have
48 * been read or EOF is reached, whichever comes first.
49 *
50 * @param resource $bz The file pointer. It must be valid and must point to a file
51 * successfully opened by bzopen.
52 * @param int $length If not specified, bzread will read 1024
53 * (uncompressed) bytes at a time. A maximum of 8192
54 * uncompressed bytes will be read at a time.
55 * @return string Returns the uncompressed data.
56 * @throws Bzip2Exception
57 *
58 */
59 function bzread($bz, int $length = 1024): string
60 {
61 error_clear_last();
62 $result = \bzread($bz, $length);
63 if ($result === false) {
64 throw Bzip2Exception::createFromPhpError();
65 }
66 return $result;
67 }
68
69
70 /**
71 * bzwrite writes a string into the given bzip2 file
72 * stream.
73 *
74 * @param resource $bz The file pointer. It must be valid and must point to a file
75 * successfully opened by bzopen.
76 * @param string $data The written data.
77 * @param int $length If supplied, writing will stop after length
78 * (uncompressed) bytes have been written or the end of
79 * data is reached, whichever comes first.
80 * @return int Returns the number of bytes written.
81 * @throws Bzip2Exception
82 *
83 */
84 function bzwrite($bz, string $data, int $length = null): int
85 {
86 error_clear_last();
87 if ($length !== null) {
88 $result = \bzwrite($bz, $data, $length);
89 } else {
90 $result = \bzwrite($bz, $data);
91 }
92 if ($result === false) {
93 throw Bzip2Exception::createFromPhpError();
94 }
95 return $result;
96 }
97