mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 14:37:01 +00:00
Unified ImageFileCache implementations
This commit is contained in:
parent
e98f5b9bff
commit
f8b0bcbeb1
7 changed files with 25 additions and 12 deletions
|
|
@ -29,6 +29,7 @@ namespace MapControl.Caching
|
|||
}
|
||||
|
||||
rootDirectory = directory;
|
||||
|
||||
Debug.WriteLine("Created ImageFileCache in " + rootDirectory);
|
||||
}
|
||||
|
||||
|
|
@ -133,6 +134,7 @@ namespace MapControl.Caching
|
|||
if (expiration.HasValue)
|
||||
{
|
||||
Array.Resize(ref buffer, buffer.Length - 16);
|
||||
|
||||
return expiration.Value;
|
||||
}
|
||||
|
||||
|
|
@ -151,5 +153,17 @@ namespace MapControl.Caching
|
|||
|
||||
return expiration;
|
||||
}
|
||||
|
||||
private static void WriteExpiration(Stream stream, DateTime expiration)
|
||||
{
|
||||
stream.Write(Encoding.ASCII.GetBytes(expiresTag), 0, 8);
|
||||
stream.Write(BitConverter.GetBytes(expiration.Ticks), 0, 8);
|
||||
}
|
||||
|
||||
private static async Task WriteExpirationAsync(Stream stream, DateTime expiration)
|
||||
{
|
||||
await stream.WriteAsync(Encoding.ASCII.GetBytes(expiresTag), 0, 8);
|
||||
await stream.WriteAsync(BitConverter.GetBytes(expiration.Ticks), 0, 8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue