1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of SwiftMailer. |
5
|
|
|
* (c) 2004-2009 Chris Corbyn |
6
|
|
|
* |
7
|
|
|
* For the full copyright and license information, please view the LICENSE |
8
|
|
|
* file that was distributed with this source code. |
9
|
|
|
*/ |
10
|
|
|
|
11
|
|
|
/** |
12
|
|
|
* An abstract means of reading and writing data in terms of characters as opposed |
13
|
|
|
* to bytes. |
14
|
|
|
* |
15
|
|
|
* Classes implementing this interface may use a subsystem which requires less |
16
|
|
|
* memory than working with large strings of data. |
17
|
|
|
* |
18
|
|
|
* @author Chris Corbyn |
19
|
|
|
*/ |
20
|
|
|
interface Swift_CharacterStream |
|
|
|
|
21
|
|
|
{ |
22
|
|
|
/** |
23
|
|
|
* Set the character set used in this CharacterStream. |
24
|
|
|
* |
25
|
|
|
* @param string $charset |
26
|
|
|
*/ |
27
|
|
|
public function setCharacterSet($charset); |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* Set the CharacterReaderFactory for multi charset support. |
31
|
|
|
* |
32
|
|
|
* @param Swift_CharacterReaderFactory $factory |
33
|
|
|
*/ |
34
|
|
|
public function setCharacterReaderFactory(Swift_CharacterReaderFactory $factory); |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* Overwrite this character stream using the byte sequence in the byte stream. |
38
|
|
|
* |
39
|
|
|
* @param Swift_OutputByteStream $os output stream to read from |
40
|
|
|
*/ |
41
|
|
|
public function importByteStream(Swift_OutputByteStream $os); |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* Import a string a bytes into this CharacterStream, overwriting any existing |
45
|
|
|
* data in the stream. |
46
|
|
|
* |
47
|
|
|
* @param string $string |
48
|
|
|
*/ |
49
|
|
|
public function importString($string); |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* Read $length characters from the stream and move the internal pointer |
53
|
|
|
* $length further into the stream. |
54
|
|
|
* |
55
|
|
|
* @param int $length |
56
|
|
|
* |
57
|
|
|
* @return string |
58
|
|
|
*/ |
59
|
|
|
public function read($length); |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* Read $length characters from the stream and return a 1-dimensional array |
63
|
|
|
* containing there octet values. |
64
|
|
|
* |
65
|
|
|
* @param int $length |
66
|
|
|
* |
67
|
|
|
* @return int[] |
68
|
|
|
*/ |
69
|
|
|
public function readBytes($length); |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* Write $chars to the end of the stream. |
73
|
|
|
* |
74
|
|
|
* @param string $chars |
75
|
|
|
*/ |
76
|
|
|
public function write($chars); |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* Move the internal pointer to $charOffset in the stream. |
80
|
|
|
* |
81
|
|
|
* @param int $charOffset |
82
|
|
|
*/ |
83
|
|
|
public function setPointer($charOffset); |
84
|
|
|
|
85
|
|
|
/** |
86
|
|
|
* Empty the stream and reset the internal pointer. |
87
|
|
|
*/ |
88
|
|
|
public function flushContents(); |
89
|
|
|
} |
90
|
|
|
|
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.