public EsriBundleFile(EsriBundleFileConfig config = null) { NewFileMode = true; if (config == null) { Config = new EsriBundleFileConfig(); Config.PacketSize = 128; } else { Config = config; } }
public EsriBundleFile(string filePath) { FilePath = filePath; NewFileMode = false; Config = new EsriBundleFileConfig(); Config.PacketSize = 128; //尝试从文件名字中读取开始行列号 try { EsriBundleHelper.ComputeOrigin(Path.GetFileName(filePath), out Config.StartCol, out Config.StartRow); } catch (Exception) { } }
public EsriBundleFile(string filePath, EsriBundleFileConfig config) : this(filePath) { Config = config; }
/// <summary> /// 读取文件头行列号 /// </summary> /// <param name="dataStream"></param> private void ReadColAndRowExtent(Stream dataStream, EsriBundleFileConfig config) { dataStream.Seek(44, SeekOrigin.Begin); // 44-47为开始行 byte[] tempBytes = new byte[4]; dataStream.Read(tempBytes, 0, 4); config.StartRow = BitConverter.ToInt32(tempBytes, 0); // 48-51为结束行 dataStream.Read(tempBytes, 0, 4); config.EndRow = BitConverter.ToInt32(tempBytes, 0); // 52-55为开始列 dataStream.Read(tempBytes, 0, 4); config.StartCol = BitConverter.ToInt32(tempBytes, 0); // 56-59为结束列 dataStream.Read(tempBytes, 0, 4); config.EndCol = BitConverter.ToInt32(tempBytes, 0); }