classes/Swift/AWSInputByteStream.php
/**
		 * Writes $bytes to the end of the stream.
		 *
		 * Writing may not happen immediately if the stream chooses to buffer.  If
		 * you want to write these bytes with immediate effect, call {@link commit()}
		 * after calling write().
		 *
		 * This method returns the sequence ID of the write (i.e. 1 for first, 2 for
		 * second, etc etc).
		 *
		 * @param string $bytes
		 * @return int
		 */
Writes $bytes to the end of the stream.
Writing may not happen immediately if the stream chooses to buffer.  If
you want to write these bytes with immediate effect, call  commit()
after calling write().

This method returns the sequence ID of the write .

@param string $bytes
@return int
Writes $bytes to the end of the stream . Writing may not happen immediately if the stream chooses to buffer . If you want to write these bytes with immediate effect call commit () after calling write () . This method returns the sequence ID of the write . @param string $bytes @return int
public function write($bytes) {
			$block = $this->buffer . $bytes;
			$block_size = strlen( $block );
			$encoded = base64_encode( $block );
			$setback = 0;
			while( substr( $encoded, -1 ) === '=' ) {
				++$setback;
				if( $setback >= $block_size ) {
					$this->buffer = $block; 
					return ++$this->counter;
				}
				$encoded = base64_encode( substr( $block, 0, $setback * -1 ) );
			}
			if( $setback > 0 ) { 
				$this->buffer = substr( $block, $setback * -1 );
			}
			else {
				$this->buffer = '';
			}
			unset( $block );
			$this->socket->write( urlencode( $encoded ) );
			unset( $encoded );
			return ++$this->counter;
		}
public function write ( $ bytes ) { $ block = $ this -> buffer . $ bytes ; $ block_size = strlen ( $ block ) ; $ encoded = base64_encode ( $ block ) ; $ setback = 0 ; while ( substr ( $ encoded , - 1 ) === '=' ) { ++ $ setback ; if ( $ setback >= $ block_size ) { $ this -> buffer = $ block ; return ++ $ this -> counter ; } $ encoded = base64_encode ( substr ( $ block , 0 , $ setback * - 1 ) ) ; } if ( $ setback > 0 ) { $ this -> buffer = substr ( $ block , $ setback * - 1 ) ; } else { $ this -> buffer = '' ; } unset ( $ block ) ; $ this -> socket -> write ( urlencode ( $ encoded ) ) ; unset ( $ encoded ) ; return ++ $ this -> counter ; }
Writes $bytes to the end of the stream.
Writes $bytes to the end of the stream .