Ejemplo n.º 1
0
 public static void FromBytes(this DbaseRecord record, byte[] data, RecyclableMemoryStreamManager manager,
                              Encoding encoding)
 {
     using (var input = manager.GetStream(Guid.NewGuid(), nameof(ZipArchiveWriters), data, 0, data.Length))
         using (var reader = new BinaryReader(input, encoding))
             record.Read(reader);
 }
Ejemplo n.º 2
0
 public static byte[] ToBytes(this DbaseRecord record, RecyclableMemoryStreamManager manager, Encoding encoding)
 {
     using (var output = manager.GetStream())
         using (var writer = new BinaryWriter(output, encoding))
         {
             record.Write(writer);
             writer.Flush();
             return(output.ToArray());
         }
 }
Ejemplo n.º 3
0
            /// <summary>
            /// Advances the enumerator to the next element of the collection.
            /// </summary>
            /// <returns>
            /// true if the enumerator was successfully advanced to the next element;
            /// false if the enumerator has passed the end of the collection.
            /// </returns>
            /// <exception cref="T:System.InvalidOperationException">
            /// The collection was modified after the enumerator was created.
            ///  </exception>
            public bool MoveNext()
            {
                _iCurrentRecord++;
                if (_iCurrentRecord <= _header.NumRecords)
                {
                    _dataRecord = this.Read();
                }
                bool more = true;

                if (_iCurrentRecord > _header.NumRecords)
                {
                    //this._dbfStream.Close();
                    more = false;
                }
                return(more);
            }