Removed dep on API
[ninja.git] / application / vendor / swiftmailer / classes / Swift / CharacterStream.php
blobbf91528228a1183f60c4712511df47ea8f4e13a2
1 <?php
3 /*
4 * This file is part of SwiftMailer.
5 * (c) 2004-2009 Chris Corbyn
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
9 */
11 require_once dirname(__FILE__) . '/OutputByteStream.php';
12 require_once dirname(__FILE__) . '/CharacterReaderFactory.php';
15 /**
16 * An abstract means of reading and writing data in terms of characters as opposed
17 * to bytes.
18 * Classes implementing this interface may use a subsystem which requires less
19 * memory than working with large strings of data.
20 * @package Swift
21 * @subpackage CharacterStream
22 * @author Chris Corbyn
24 interface Swift_CharacterStream
27 /**
28 * Set the character set used in this CharacterStream.
29 * @param string $charset
31 public function setCharacterSet($charset);
33 /**
34 * Set the CharacterReaderFactory for multi charset support.
35 * @param Swift_CharacterReaderFactory $factory
37 public function setCharacterReaderFactory(
38 Swift_CharacterReaderFactory $factory);
40 /**
41 * Overwrite this character stream using the byte sequence in the byte stream.
42 * @param Swift_OutputByteStream $os output stream to read from
44 public function importByteStream(Swift_OutputByteStream $os);
46 /**
47 * Import a string a bytes into this CharacterStream, overwriting any existing
48 * data in the stream.
49 * @param string $string
51 public function importString($string);
53 /**
54 * Read $length characters from the stream and move the internal pointer
55 * $length further into the stream.
56 * @param int $length
57 * @return string
59 public function read($length);
61 /**
62 * Read $length characters from the stream and return a 1-dimensional array
63 * containing there octet values.
64 * @param int $length
65 * @return int[]
67 public function readBytes($length);
69 /**
70 * Write $chars to the end of the stream.
71 * @param string $chars
73 public function write($chars);
75 /**
76 * Move the internal pointer to $charOffset in the stream.
77 * @param int $charOffset
79 public function setPointer($charOffset);
81 /**
82 * Empty the stream and reset the internal pointer.
84 public function flushContents();