Similar to `ReadString` but expects a variable length indicator instead of the fixed 1 byte indicator.

        Args:
            max (int): (Optional) maximum number of bytes to read.

        Returns:
            bytes:
509977
def ReadVarString(self, max=sys.maxsize):
        
        length = self.ReadVarInt(max)
        return self.unpack(str(length) + 's', length)
1065095
def _readString(self, length_fmt="H"):
        
        (length,) = self._readStruct(">{0}".format(length_fmt))
        ba = self.object_stream.read(length)
        return to_unicode(ba)
159935
def max(self) -> int:
        
        if self.signed:
            v = (1 << (self.bits - 1)) - 1
        else:
            v = (1 << self.bits) - 1
        if self.lsb0:
            v = v - (v % 2)
        return v
1135370
def readinto(self, byte_array):
        
        max_size = len(byte_array)
        data = self.read(max_size)
        bytes_read = len(data)
        byte_array[:bytes_read] = data
        return bytes_read
759955
def read_maxquant(f, header=0, index_col='id', **kwargs):
    
    df = pd.read_csv(f, delimiter='\t', header=header, index_col=index_col, **kwargs)

    return df
415554
def read(self, size=sys.maxsize):
        
        blob_size = int(self.blob_properties.get('content-length'))
        if self._pointer < blob_size:
            chunk = self._download_chunk_with_retries(
                chunk_offset=self._pointer, chunk_size=size)
            self._pointer += size
            return chunk
653421
def ReadString(self):
        
        length = self.ReadUInt8()
        return self.unpack(str(length) + 's', length)
416503
def read_data(self):
        # type: () -> ByteString
        
        try:
            size = int(self.get_header("content-length"))
        except (ValueError, TypeError):
            size = -1

        return self.get_rfile().read(size)
1050100
def readBytes(self):
        
        length, is_reference = self._readLength()

        if is_reference:
            return self.context.getString(length)

        if length == 0:
            return ''

        result = self.stream.read(length)
        self.context.addString(result)

        return result
471694
def max(self):
        
        res = self._qexec("max(%s)" % self._name)
        if len(res) > 0:
            self._max = res[0][0]
        return self._max
637231
def read(self, n):
        
        buf = self._read_buf
        pos = self._read_pos
        end = pos + n

        if end <= len(buf):
            # Fast path: the data to read is fully buffered.
            self._read_pos += n
            return self._update_pos(buf[pos:end])

        # Slow path: read from the stream until enough bytes are read,
        # or until an EOF occurs or until read() would block.
        wanted = max(self.buffer_size, n)
        while len(buf) < end:
            chunk = self.raw.read(wanted)
            if not chunk:
                break
            buf += chunk

        self._read_buf = buf[end:]  # Save the extra data in the buffer.
        self._read_pos = 0
        return self._update_pos(buf[pos:end])
131706
def max_end(self):
        
        return max(len(self.input_string), self._max_end) if self.input_string else self._max_end
1192737
async def read_line(stream: asyncio.StreamReader) -> bytes:
    
    # Security: this is bounded by the StreamReader's limit (default = 32 KiB).
    line = await stream.readline()
    # Security: this guarantees header values are small (hard-coded = 4 KiB)
    if len(line) > MAX_LINE:
        raise ValueError("Line too long")
    # Not mandatory but safe - https://tools.ietf.org/html/rfc7230#section-3.5
    if not line.endswith(b"\r\n"):
        raise ValueError("Line without CRLF")
    return line[:-2]
650364
private int readCustomLine(Text str, int maxLineLength, int maxBytesToConsume)
            throws IOException
    {
        /* We're reading data from inputStream, but the head of the stream may be
         *  already captured in the previous buffer, so we have several cases:
         *
         * 1. The buffer tail does not contain any character sequence which
         *    matches with the head of delimiter. We count it as a
         *    ambiguous byte count = 0
         *
         * 2. The buffer tail contains a X number of characters,
         *    that forms a sequence, which matches with the
         *    head of delimiter. We count ambiguous byte count = X
         *
         *    // ***  eg: A segment of input file is as follows
         *
         *    " record 1792: I found this bug very interesting and
         *     I have completely read about it. record 1793: This bug
         *     can be solved easily record 1794: This ."
         *
         *    delimiter = "record";
         *
         *    supposing:- String at the end of buffer =
         *    "I found this bug very interesting and I have completely re"
         *    There for next buffer = "ad about it. record 179       ...."
         *
         *     The matching characters in the input
         *     buffer tail and delimiter head = "re"
         *     Therefore, ambiguous byte count = 2 ****   //
         *
         *     2.1 If the following bytes are the remaining characters of
         *         the delimiter, then we have to capture only up to the starting
         *         position of delimiter. That means, we need not include the
         *         ambiguous characters in str.
         *
         *     2.2 If the following bytes are not the remaining characters of
         *         the delimiter ( as mentioned in the example ),
         *         then we have to include the ambiguous characters in str.
         */
        str.clear();
        int txtLength = 0; // tracks str.getLength(), as an optimization
        long bytesConsumed = 0;
        int delPosn = 0;
        int ambiguousByteCount = 0; // To capture the ambiguous characters count
        do {
            int startPosn = bufferPosn; // Start from previous end position
            if (bufferPosn >= bufferLength) {
                startPosn = bufferPosn = 0;
                bufferLength = fillBuffer(in, buffer, ambiguousByteCount > 0);
                if (bufferLength <= 0) {
                    if (ambiguousByteCount > 0) {
                        str.append(recordDelimiterBytes, 0, ambiguousByteCount);
                        bytesConsumed += ambiguousByteCount;
                    }
                    break; // EOF
                }
            }
            for (; bufferPosn < bufferLength; ++bufferPosn) {
                if (buffer[bufferPosn] == recordDelimiterBytes[delPosn]) {
                    delPosn++;
                    if (delPosn >= recordDelimiterBytes.length) {
                        bufferPosn++;
                        break;
                    }
                }
                else if (delPosn != 0) {
                    bufferPosn -= delPosn;
                    if (bufferPosn < -1) {
                        bufferPosn = -1;
                    }
                    delPosn = 0;
                }
            }
            int readLength = bufferPosn - startPosn;
            bytesConsumed += readLength;
            int appendLength = readLength - delPosn;
            if (appendLength > maxLineLength - txtLength) {
                appendLength = maxLineLength - txtLength;
                if (appendLength > 0) {
                    // We want to fail the read when the line length is over the limit.
                    throw new TextLineLengthLimitExceededException("Too many bytes before delimiter: " + maxLineLength);
                }
            }
            bytesConsumed += ambiguousByteCount;
            if (appendLength >= 0 && ambiguousByteCount > 0) {
                //appending the ambiguous characters (refer case 2.2)
                str.append(recordDelimiterBytes, 0, ambiguousByteCount);
                ambiguousByteCount = 0;
                // since it is now certain that the split did not split a delimiter we
                // should not read the next record: clear the flag otherwise duplicate
                // records could be generated
                unsetNeedAdditionalRecordAfterSplit();
            }
            if (appendLength > 0) {
                int newTxtLength = txtLength + appendLength;
                if (str.getBytes().length < newTxtLength && Math.max(newTxtLength, txtLength << 1) > MAX_ARRAY_SIZE) {
                    // If str need to be resized but the target capacity is over VM limit, it will trigger OOM.
                    // In such case we will throw an IOException so the caller can deal with it.
                    throw new TextLineLengthLimitExceededException("Too many bytes before delimiter: " + newTxtLength);
                }
                str.append(buffer, startPosn, appendLength);
                txtLength = newTxtLength;
            }
            if (bufferPosn >= bufferLength) {
                if (delPosn > 0 && delPosn < recordDelimiterBytes.length) {
                    ambiguousByteCount = delPosn;
                    bytesConsumed -= ambiguousByteCount; //to be consumed in next
                }
            }
        }
        while (delPosn < recordDelimiterBytes.length
                && bytesConsumed < maxBytesToConsume);
        if (delPosn < recordDelimiterBytes.length
                && bytesConsumed >= maxBytesToConsume) {
            // It is possible that bytesConsumed is over the maxBytesToConsume but we
            // didn't append anything to str.bytes. If we have consumed over maxBytesToConsume
            // bytes but still haven't seen a line terminator, we will fail the read.
            throw new TextLineLengthLimitExceededException("Too many bytes before delimiter: " + bytesConsumed);
        }
        return (int) bytesConsumed;
    }
475732
def read_str(self):
        
        length = self.read_uint8()
        return self.unpack(str(length) + 's', length)
689798
def max_input_length(self) -> int:
        
        if self.source_with_eos:
            return self._max_input_length - C.SPACE_FOR_XOS
        else:
            return self._max_input_length
693881
def read_string(self):
        
        length = self.read_int()
        return str(self.read(length).decode("UTF-8"))