| Conditions | 3 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | public function __construct($file, bool $isAppend = false, int $bufferSize = null) |
||
| 20 | { |
||
| 21 | parent::__construct(new FileOutputStream($file, $isAppend)); |
||
| 22 | |||
| 23 | // fwriteのデフォルトバッファリングサイズは8KBなので、指定無しの場合は8KBになる |
||
| 24 | // また、同じストリームに対して出力を行うプロセスが複数ある場合、8KBごとに停止する |
||
| 25 | // see: http://php.net/manual/ja/function.stream-set-write-buffer.php |
||
| 26 | if ($bufferSize !== null && stream_set_write_buffer($this->stream, $bufferSize) !== 0) { |
||
| 27 | throw new IOException("Failed to change the buffer size."); |
||
| 28 | } |
||
| 29 | } |
||
| 30 | |||
| 40 |