vendor/swiftmailer/lib/classes/Swift/CharacterStream.php
changeset 0 7f95f8617b0b
equal deleted inserted replaced
-1:000000000000 0:7f95f8617b0b
       
     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 require_once dirname(__FILE__) . '/OutputByteStream.php';
       
    12 require_once dirname(__FILE__) . '/CharacterReaderFactory.php';
       
    13 
       
    14 
       
    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
       
    23  */
       
    24 interface Swift_CharacterStream
       
    25 {
       
    26 
       
    27   /**
       
    28    * Set the character set used in this CharacterStream.
       
    29    * @param string $charset
       
    30    */
       
    31   public function setCharacterSet($charset);
       
    32   
       
    33   /**
       
    34    * Set the CharacterReaderFactory for multi charset support.
       
    35    * @param Swift_CharacterReaderFactory $factory
       
    36    */
       
    37   public function setCharacterReaderFactory(
       
    38     Swift_CharacterReaderFactory $factory);
       
    39   
       
    40   /**
       
    41    * Overwrite this character stream using the byte sequence in the byte stream.
       
    42    * @param Swift_OutputByteStream $os output stream to read from
       
    43    */
       
    44   public function importByteStream(Swift_OutputByteStream $os);
       
    45   
       
    46   /**
       
    47    * Import a string a bytes into this CharacterStream, overwriting any existing
       
    48    * data in the stream.
       
    49    * @param string $string
       
    50    */
       
    51   public function importString($string);
       
    52   
       
    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
       
    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    * @param int $length
       
    65    * @return int[]
       
    66    */
       
    67   public function readBytes($length);
       
    68   
       
    69   /**
       
    70    * Write $chars to the end of the stream.
       
    71    * @param string $chars
       
    72    */
       
    73   public function write($chars);
       
    74   
       
    75   /**
       
    76    * Move the internal pointer to $charOffset in the stream.
       
    77    * @param int $charOffset
       
    78    */
       
    79   public function setPointer($charOffset);
       
    80   
       
    81   /**
       
    82    * Empty the stream and reset the internal pointer.
       
    83    */
       
    84   public function flushContents();
       
    85   
       
    86 }