| @@ 19-37 (lines=19) @@ | ||
| 16 | * @throws EndOfFileReachedException |
|
| 17 | * |
|
| 18 | */ |
|
| 19 | public function read(): array |
|
| 20 | { |
|
| 21 | $bytes = []; |
|
| 22 | ||
| 23 | $this->assertNotEndOfFile(); |
|
| 24 | $bytes[] = $this->getByte($this->offset++); |
|
| 25 | $this->assertNotEndOfFile(); |
|
| 26 | $bytes[] = $this->getByte($this->offset++); |
|
| 27 | $this->assertNotEndOfFile(); |
|
| 28 | $bytes[] = $this->getByte($this->offset++); |
|
| 29 | $this->assertNotEndOfFile(); |
|
| 30 | $bytes[] = $this->getByte($this->offset++); |
|
| 31 | ||
| 32 | $data = $this->endianMode->applyEndianess($bytes); |
|
| 33 | ||
| 34 | return [ |
|
| 35 | $this->mergeBytes($data), |
|
| 36 | ]; |
|
| 37 | } |
|
| 38 | ||
| 39 | /** |
|
| 40 | * @param int $length |
|
| @@ 19-37 (lines=19) @@ | ||
| 16 | * |
|
| 17 | * @return array |
|
| 18 | */ |
|
| 19 | public function read(): array |
|
| 20 | { |
|
| 21 | $bytes = []; |
|
| 22 | ||
| 23 | $this->assertNotEndOfFile(); |
|
| 24 | $bytes[] = $this->getByte($this->offset++); |
|
| 25 | $this->assertNotEndOfFile(); |
|
| 26 | $bytes[] = $this->getByte($this->offset++); |
|
| 27 | $this->assertNotEndOfFile(); |
|
| 28 | $bytes[] = $this->getByte($this->offset++); |
|
| 29 | $this->assertNotEndOfFile(); |
|
| 30 | $bytes[] = $this->getByte($this->offset++); |
|
| 31 | ||
| 32 | $data = $this->endianMode->applyEndianess($bytes); |
|
| 33 | ||
| 34 | return [ |
|
| 35 | $this->mergeBytes($data), |
|
| 36 | ]; |
|
| 37 | } |
|
| 38 | ||
| 39 | /** |
|
| 40 | * @param int $length |
|