예제 #1
0
        public static List <ShapefileRecord> GetAllMainRecords(FileStream stream)
        {
            List <ShapefileRecord> records = new List <ShapefileRecord>();

            byte[] streamBuffer;
            try
            {
                stream.Position = HeaderLengthInBytes;
                do
                {
                    streamBuffer = ReadBytesFromStream(stream, 8);
                    if (streamBuffer.Length < 8)
                    {
                        break;
                    }
                    else
                    {
                        ShapefileRecord myRecord = new ShapefileRecord(streamBuffer);
                        myRecord.SetRecordContents(ReadBytesFromStream(stream, myRecord.ContentLength * 2));
                        records.Add(myRecord);
                    }
                } while (streamBuffer.Length > 0);
            }
            catch
            {
                //Clear the list so it is returned empty.
                records.Clear();
            }
            return(records);
        }
 private static Multipoint[] GetMultipointParts(ShapefileRecord record)
 {
     return(GetMultipointParts(record.RecordContents));
 }