def buffer_read(library, session, count):
    """Reads data from device or interface through the use of a formatted I/O read buffer.

    Corresponds to viBufRead function of the VISA library.

    :param library: the visa library wrapped by ctypes.
    :param session: Unique logical identifier to a session.
    :param count: Number of bytes to be read.
    :return: data read, return value of the library call.
    :rtype: bytes, :class:`pyvisa.constants.StatusCode`
    """
    buffer = create_string_buffer(count)
    return_count = ViUInt32()
    ret = library.viBufRead(session, buffer, count, byref(return_count))
    return buffer.raw[:return_count.value], ret
Reads data from device or interface through the use of a formatted I/O read buffer.

    Corresponds to viBufRead function of the VISA library.

    :param library: the visa library wrapped by ctypes.
    :param session: Unique logical identifier to a session.
    :param count: Number of bytes to be read.
    :return: data read, return value of the library call.
    :rtype: bytes, :class:`pyvisa.constants.StatusCode`