| 1 | <?php |
||
| 12 | class ByteString extends AbstractType |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @var int|string |
||
| 16 | */ |
||
| 17 | private $length; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @param int $length |
||
| 21 | * @param int $byteOrder |
||
| 22 | */ |
||
| 23 | 14 | public function __construct(int $length, int $byteOrder = ByteOrder::BE) |
|
| 28 | |||
| 29 | /** |
||
| 30 | * @param Buffer $string |
||
| 31 | * @return string |
||
| 32 | * @throws \Exception |
||
| 33 | 12 | */ |
|
| 34 | public function write($string): string |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @param Parser $parser |
||
| 49 | * @return BufferInterface |
||
| 50 | 12 | * @throws \BitWasp\Buffertools\Exceptions\ParserOutOfRange |
|
| 51 | */ |
||
| 52 | 12 | public function read(Parser $parser): BufferInterface |
|
| 61 | } |
||
| 62 |