OutputByteStream.php 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. * Classes implementing this interface may use a subsystem which requires less
  12. * memory than working with large strings of data.
  13. * @package Swift
  14. * @subpackage ByteStream
  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. If less bytes exist than are requested the
  22. * remaining bytes are given instead. If no bytes are remaining at all, boolean
  23. * false is returned.
  24. * @param int $length
  25. * @return string
  26. * @throws Swift_IoException
  27. */
  28. public function read($length);
  29. /**
  30. * Move the internal read pointer to $byteOffset in the stream.
  31. * @param int $byteOffset
  32. * @return boolean
  33. * @throws Swift_IoException
  34. */
  35. public function setReadPointer($byteOffset);
  36. }