OutputByteStream.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /*
  3. * This file is part of SwiftMailer.
  4. * (c) 2004-2009 Chris Corbyn
  5. *
  6. * For the full copyright and license information, please view the LICENSE
  7. * file that was distributed with this source code.
  8. */
  9. /**
  10. * An abstract means of reading data.
  11. *
  12. * Classes implementing this interface may use a subsystem which requires less
  13. * memory than working with large strings of data.
  14. *
  15. * @author Chris Corbyn
  16. */
  17. interface Swift_OutputByteStream
  18. {
  19. /**
  20. * Reads $length bytes from the stream into a string and moves the pointer
  21. * through the stream by $length.
  22. *
  23. * If less bytes exist than are requested the remaining bytes are given instead.
  24. * If no bytes are remaining at all, boolean false is returned.
  25. *
  26. * @param int $length
  27. *
  28. * @return string|bool
  29. *
  30. * @throws Swift_IoException
  31. */
  32. public function read($length);
  33. /**
  34. * Move the internal read pointer to $byteOffset in the stream.
  35. *
  36. * @param int $byteOffset
  37. *
  38. * @return bool
  39. *
  40. * @throws Swift_IoException
  41. */
  42. public function setReadPointer($byteOffset);
  43. }