public function writeDouble(Stream $stream, $value)
    {
        $bytes = pack('d*', $value);

        if ($this->isBigEndian) {
            $bytes = strrev($bytes);
        }

        $this->writeBytes($stream, $bytes, 8);
    }