'Parse a Server Hello record from body.
Body should start with the byte representation of an RFC 5246
struct Server Hello.
Returns a ServerHello and the number of bytes read from body
Throws a struct.error or IndexError if there is not enough data to parse
properly.'

@staticmethod
def from_stream(body):

    (version, index) = Version.from_stream(body)
    (random, read_amt) = Random.from_stream(body[index:])
    index += read_amt
    sessionid_length = struct.unpack_from('B', body, index)[0]
    index += 1
    (session_id, read_amt) = parse.parse_tls_list(body[index:], sessionid_length, parse.parse_opaque)
    index += read_amt
    (cipher, read_amt) = Cipher.from_stream(body[index:])
    index += read_amt
    (method, read_amt) = CompressionMethod.from_stream(body[index:])
    index += read_amt
    extensions = []
    if (len(body) != index):
        extensions_length = struct.unpack_from('!H', body, index)[0]
        index += 2
        (extensions, read_amt) = parse.parse_tls_list(body[index:], extensions_length, Extension.from_stream)
        index += read_amt
    return (ServerHello(version, random, session_id, cipher, method, extensions), index)
