<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def read (self, stream):
 """Reads PCapGlobalHeader data from the given stream."""

        self._data = stream.read(self._size)

        if len(self._data) >= self._size:
            values = struct.unpack(self._format, self._data)
        else:
            values = None, None, None, None, None, None, None

        if   values[0] == 0xA1B2C3D4 or values[0] == 0xA1B23C4D:
            self._swap = '@'
        elif values[0] == 0xD4C3B2A1 or values[0] == 0x4D3CB2A1:
            self._swap = EndianSwap

        if values[0] is not None:
            values = struct.unpack(self._swap + self._format, self._data)

        self.magic_number  = values[0]
        self.version_major = values[1]
        self.version_minor = values[2]
        self.thiszone      = values[3]
        self.sigfigs       = values[4]
        self.snaplen       = values[5]
        self.network       = values[6]