public TData ReadAsDataFile <TData>(string virtualUri = null, int dataSizeInBytes = -1) where TData : DataFile, new() { byte[] data = ReadBytes((dataSizeInBytes < 0) ? (int)Length : dataSizeInBytes); return(DataFile.LoadFromBytes <TData>(data, virtualUri ?? FileName)); }
public void WriteDataFile <TData>(TData data, string virtualUri) where TData : DataFile, new() { byte[] bytes = DataFile.SaveAsBytes(data, virtualUri); Write(bytes); }