//--------------------------------------------------------------------------------------------------

        public double ReadDouble()
        {
            Debug.Assert(DxfUtils.GetTypeForGroupCode(_GroupCode) == DxfUtils.Types.Double);

            double value = 0.0;

            if (_IsBinary)
            {
                var buffer = new byte[DxfUtils.GetBinarySize(DxfUtils.Types.Double)];
                if (_Stream.Read(buffer, 0, buffer.Length) != buffer.Length)
                {
                    Messages.Error($"Binary DXF is invalid/not complete.");
                    _GroupCode = -1;
                }
                else
                {
                    value = BitConverter.ToDouble(buffer, 0);
                }
            }
            else
            {
                if (!_Reader.EndOfStream)
                {
                    var s = _Reader.ReadLine()?.Trim();
                    if (!s.IsNullOrEmpty())
                    {
                        double.TryParse(s, NumberStyles.Float, CultureInfo.InvariantCulture, out value);
                    }
                }
            }

            _ReadGroupCode();
            return(value);
        }
        //--------------------------------------------------------------------------------------------------

        public void Skip()
        {
            if (_IsBinary)
            {
                var type = DxfUtils.GetTypeForGroupCode(_GroupCode);
                switch (type)
                {
                case DxfUtils.Types.String:
                {
                    int readByte;
                    do
                    {
                        readByte = _Stream.ReadByte();
                    } while (readByte > 0);

                    break;
                }

                case DxfUtils.Types.ByteChunk:
                {
                    int readByte = _Stream.ReadByte();
                    if (readByte == -1)
                    {
                        Messages.Error($"Binary DXF is invalid/not complete.");
                        _GroupCode = -1;
                        return;
                    }

                    _Stream.Seek(readByte, SeekOrigin.Current);
                    break;
                }

                default:
                {
                    int typeSize = DxfUtils.GetBinarySize(type);
                    if (typeSize == 0)
                    {
                        Messages.Error($"Binary DXF has group code {_GroupCode} of unknown type, the file cannot correctly parsed, in line {_Line}");
                        _GroupCode = -1;
                        return;
                    }

                    _Stream.Seek(typeSize, SeekOrigin.Current);
                    break;
                }
                }
            }
            else
            {
                if (_Reader.EndOfStream)
                {
                    return;
                }

                _Reader.ReadLine();
            }
            _ReadGroupCode();
        }