コード例 #1
0
        public void CanReadWrite()
        {
            var sut = new ShapeIndexRecord(
                _fixture.Create <WordOffset>(),
                _fixture.Create <WordLength>());

            using (var stream = new MemoryStream())
            {
                using (var writer = new BinaryWriter(stream, Encoding.ASCII, true))
                {
                    sut.Write(writer);
                    writer.Flush();
                }

                stream.Position = 0;

                using (var reader = new BinaryReader(stream, Encoding.ASCII, true))
                {
                    var result = ShapeIndexRecord.Read(reader);

                    Assert.Equal(sut.Offset, result.Offset);
                    Assert.Equal(sut.ContentLength, result.ContentLength);
                }
            }
        }
コード例 #2
0
        public void Write(ShapeIndexRecord record)
        {
            if (record == null)
            {
                throw new ArgumentNullException(nameof(record));
            }

            record.Write(Writer);
        }
コード例 #3
0
        public void Write(ShapeIndexRecord record)
        {
            if (record == null)
            {
                throw new ArgumentNullException(nameof(record));
            }
            if (_disposed)
            {
                throw new ObjectDisposedException(nameof(DbaseBinaryWriter));
            }

            record.Write(Writer);
        }