OutputByteStream.php 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. * @package Swift
  16. * @subpackage ByteStream
  17. * @author Chris Corbyn
  18. */
  19. interface Swift_OutputByteStream
  20. {
  21. /**
  22. * Reads $length bytes from the stream into a string and moves the pointer
  23. * through the stream by $length.
  24. *
  25. * If less bytes exist than are requested the remaining bytes are given instead.
  26. * If no bytes are remaining at all, boolean false is returned.
  27. *
  28. * @param integer $length
  29. *
  30. * @return string|boolean
  31. *
  32. * @throws Swift_IoException
  33. */
  34. public function read($length);
  35. /**
  36. * Move the internal read pointer to $byteOffset in the stream.
  37. *
  38. * @param integer $byteOffset
  39. *
  40. * @return boolean
  41. *
  42. * @throws Swift_IoException
  43. */
  44. public function setReadPointer($byteOffset);
  45. }