input
@param string $recv_buffer
767825
public static function input($recv_buffer)
    {
        if(strlen($recv_buffer) < self::PACKAGE_FIXED_LENGTH)
        {
            return 0;
        }
        $data = unpack("Cmodule_name_len/Cinterface_name_len/fcost_time/Csuccess/Ncode/nmsg_len/Ntime", $recv_buffer);
        return $data['module_name_len'] + $data['interface_name_len'] + $data['msg_len'] + self::PACKAGE_FIXED_LENGTH;
    }
298059
function processInput(buffer, cb) {
    if (buffer.length == 0) return buffer;
    var split_char = '\n';
    var lines = buffer.split(split_char);
    // If there are any line splits, the below logic always works, but if there are none we need to detect this and skip
    // any processing.
    if (lines[0].length == buffer.length) return buffer;
    // Note last item is ignored since it is the remainder (or empty)
    for(var i = 0; i < lines.length-1; i++) {
        var line = lines[i];
        if (format == "binary") {
            target.produce(line, handleProduceResponse.bind(undefined, cb));
        } else if (format == "avro") {
            // Avro data should be passed in its JSON-serialized form
            try {
                var avro = JSON.parse(line);
            } catch (e) {
                console.log("Couldn't parse '" + line + "' as JSON");
                continue;
            }
            target.produce(valueSchema, avro, handleProduceResponse.bind(undefined, cb));
        }
        // OR with key or partition:
        //target.produce({'partition': 0, 'value': line}, handleProduceResponse.bind(undefined, cb));
        //target.produce({'key': 'console', 'value': line}, handleProduceResponse.bind(undefined, cb));
        num_messages += 1;
        num_bytes += line.length;
    }
    return lines[lines.length-1];
}
9100
function addString($string_to_add){
		settype($string_to_add,"string");
		if(strlen($string_to_add)>0){
			$this->_Buffer[] = new StringBufferItem($string_to_add);
		}
	}
1235598
public function write($buffer, $length = 0)
    {
        if ("\n" != substr($buffer, -1)) {
            $buffer .= "\n";
        }
        if (!$length) {
            $length = strlen($buffer);
        }

        return socket_write($this->socket, $buffer, $length);
    }
970907
final public function read($byte_count=null)
    {

        $buffer = '';
        $read = array($this->socket);

        $updated = @stream_select($read, $write, $except, 1);

        if ($updated > 0) {
            $data = fread($this->socket, 4096);
            if($data) {
                   $buffer = $data;
            }

        }

        if(!empty($buffer)){
            $this->log('RECEIVED: '.$buffer);
        }

        return $buffer;
    }
901875
public static function input($prompt = null, $raw = false)
    {
        if (isset($prompt)) {
            static::stdout($prompt);
        }
        return static::stdin($raw);
    }
735121
public static function input($buffer, TcpConnection $connection)
    {
        // Judge whether the package length exceeds the limit.
        if (strlen($buffer) >= $connection->maxPackageSize) {
            $connection->close();
            return 0;
        }
        //  Find the position of  "\n".
        $pos = strpos($buffer, "\n");
        // No "\n", packet length is unknown, continue to wait for the data so return 0.
        if ($pos === false) {
            return 0;
        }
        // Return the current package length.
        return $pos + 1;
    }
652259
public static <B extends Buffer> Input<B> fromSource(
            ManagedBuffer<B> buffer, boolean endOfRecord) {
        return new Input<>(buffer, endOfRecord);
    }
816684
synchronized void setInputFromSavedData() {
    int len = Math.min(userBufLen, uncompressedDirectBuf.remaining());
    ((ByteBuffer)uncompressedDirectBuf).put(userBuf, userBufOff, len);
    userBufLen -= len;
    userBufOff += len;
    uncompressedDirectBufLen = uncompressedDirectBuf.position();
  }
290117
def parser
      until $input_buffer.empty?
        line = $input_buffer.shift
        do_debug :in, ">#{line}"
        @args = line.split ' '
        @label = @args.shift
        @cmd   = @args.shift
        case @cmd
        # CMD Generales
        when 'OK'
        when 'NOOK'
        when 'RSALDO'
        when 'PING'
          cmd_pong @args[0], @label
        when 'PONG'
          cmd_ping @args[0], @label
        when 'RINFONUM'
        when 'RTARIFA'
        when 'BYE'
          close!
        # CMD Envios MT
        when 'SUBMITOK'
        when 'BSUBMITOK'
        when 'USUBMITOK'
        when 'FSUBMITOK'
        when 'FBSUBMITOK'
        when 'FUSUBMITOK'
        when 'WAPLINKOK'
        when 'REJDST'
        when 'ACUSE'
        when 'ACUSEACKR'
        when 'RTRANS'
        # CMD Recepcion SMS (no premium)
        when 'INCOMINGMO'

        # CMD Recepcion SMS (premium)

        else
          do_event :unknow
        end
        do_event @cmd.downcase
        do_event :all
      end
    end
75356
public function input($buffer, $connection) {        
        $len = strlen($buffer);
        
        $method = substr($buffer, 0, strpos($buffer, ' '));
        if($len >= 8 && !in_array($method, $this->methods)) {
            throw new \Exception('Bad Request Method', 400);
        }
        
        
        if (!strpos($buffer, "\r\n\r\n")) {
            if ($len >= $this->max_header_size) {
                throw new \Exception('Too Large Request Header', 412);
            }
            return 0;
        }
        
        list($header,$body) = explode("\r\n\r\n", $buffer, 2);
        
        if (strlen($header) >= $this->max_header_size) {
            throw new \Exception('Too Large Request Header', 413);
        }
        
        return $this->getRequestSize($header, $body, $method, $connection);
    }
377178
protected function write($buffer)
    {
        $socket = $this->getResource();

        while (($length = strlen($buffer)) > 0) {
            $written = @fwrite($socket, $buffer);

            if ($length === $written) {
                return;
            }

            if ($written === false || $written === 0) {
                $this->onConnectionError('Error while writing bytes to the server.');
            }

            $buffer = substr($buffer, $written);
        }
    }
483192
public function send($send_buffer, $raw = false)
    {
        if (false === $raw && $this->protocol) {
            $parser      = $this->protocol;
            $send_buffer = $parser::encode($send_buffer, $this);
            if ($send_buffer === '') {
                return null;
            }
        }
        return strlen($send_buffer) === stream_socket_sendto($this->_socket, $send_buffer, 0, $this->_remoteAddress);
    }
208578
public function handleRead()
    {
        $length = $this->bufferSize;
        $ret = fread($this->resource, $length);

        if ($ret === false)
        {
            $this->emit('error', [ $this, new ReadException('Error occurred while reading from the stream resource.') ]);
            return;
        }

        if ($ret !== '')
        {
            $this->emit('data', [ $this, $ret ]);

            if (strlen($ret) < $length)
            {
                $this->loop->removeReadStream($this->resource);
                $this->reading = false;
                $this->emit('end', [ $this ]);
            }
        }
    }
1324029
public function loadRequest($buffer)
    {
        $this->requestAt = microtime(true);
        
        
        list($this->_rawHeader, $this->_rawBody) = explode("\r\n\r\n", $buffer, 2);
        
        $headers = explode("\r\n", $this->_rawHeader, 2);
        
        list($this->method, $this->uri, $this->version) = explode(' ',$headers[0]);
        
        $this->loadHeaders();
        
        $this->loadBody();
        
        $this->_REQUEST = array_merge($this->_GET, $this->_POST);
        
        $this->loadServerVars();
        $this->loadGet();
        
    }
469424
public function onRead()
    {
        if (!$this->client) {
            return;
        }
        do {
            $this->client->writeFromBuffer($this->bev->input, $this->bev->input->length);
        } while ($this->bev->input->length > 0);
    }
344349
public function input()
    {
        return array_replace_recursive($this->query->all(), $this->attributes->all(), $this->request->all());
    }