public IHgtDataCell GetCellFor(HgtCellCoords coords) { var path = _pathResolver.FindFilePath(coords); FileStream file = null; try { int fileSize = (int)new FileInfo(path).Length; file = File.Open(path, FileMode.Open, FileAccess.Read, FileShare.Read); return(new HgtDataCellInFile(file, HgtUtils.PointsPerCellFromDataLength(fileSize), coords)); } catch (Exception) { if (file != null) { file.Dispose(); } throw; } }
public async Task <IHgtDataCell> GetCellForAsync(HgtCellCoords coords) { var data = await _loader.LoadFromFileAsync(coords); return(new HgtDataCellInMemory(data, HgtUtils.PointsPerCellFromDataLength(data.Length), coords)); }
public IHgtDataCell GetCellFor(HgtCellCoords coords) { var data = _loader.LoadFromFile(coords); return(new HgtDataCellInMemory(data, HgtUtils.PointsPerCellFromDataLength(data.Length), coords)); }