Bytes20.php 941 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /*
  3. * This file is a part of "charcoal-dev/buffers" package.
  4. * https://github.com/charcoal-dev/buffers
  5. *
  6. * Copyright (c) Furqan A. Siddiqui <hello@furqansiddiqui.com>
  7. *
  8. * For the full copyright and license information, please view the LICENSE
  9. * file that was distributed with this source code or visit following link:
  10. * https://github.com/charcoal-dev/buffers/blob/master/LICENSE
  11. */
  12. declare(strict_types=1);
  13. namespace Charcoal\Buffers\Frames;
  14. use Charcoal\Buffers\AbstractFixedLenBuffer;
  15. /**
  16. * Class Bytes20
  17. * - Use this frame for buffers of precisely 20 bytes.
  18. * - If value is smaller than 20 bytes, LengthException will be thrown.
  19. * @package Charcoal\Buffers\Frames
  20. */
  21. class Bytes20 extends AbstractFixedLenBuffer
  22. {
  23. public const SIZE = 20; // Fixed frame-size of 20 bytes
  24. protected const PAD_TO_LENGTH = null; // No padding, constructor argument MUST be precisely 20 bytes
  25. use CompareSmallFramesTrait;
  26. }