mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2024-11-14 10:49:41 +01:00
Add keepOpen parameter to AsStream and AsStorage
This commit is contained in:
parent
b5c9e13df3
commit
9e3c41ed2c
1 changed files with 13 additions and 0 deletions
|
@ -42,6 +42,7 @@ namespace LibHac.IO
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Stream AsStream(this IStorage storage) => new StorageStream(storage, true);
|
public static Stream AsStream(this IStorage storage) => new StorageStream(storage, true);
|
||||||
|
public static Stream AsStream(this IStorage storage, bool keepOpen) => new StorageStream(storage, keepOpen);
|
||||||
|
|
||||||
public static void CopyTo(this IStorage input, IStorage output, IProgressReport progress = null)
|
public static void CopyTo(this IStorage input, IStorage output, IProgressReport progress = null)
|
||||||
{
|
{
|
||||||
|
@ -112,6 +113,12 @@ namespace LibHac.IO
|
||||||
return new StreamStorage(stream, true);
|
return new StreamStorage(stream, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Storage AsStorage(this Stream stream, bool keepOpen)
|
||||||
|
{
|
||||||
|
if (stream == null) return null;
|
||||||
|
return new StreamStorage(stream, keepOpen);
|
||||||
|
}
|
||||||
|
|
||||||
public static Storage AsStorage(this Stream stream, long start)
|
public static Storage AsStorage(this Stream stream, long start)
|
||||||
{
|
{
|
||||||
if (stream == null) return null;
|
if (stream == null) return null;
|
||||||
|
@ -123,5 +130,11 @@ namespace LibHac.IO
|
||||||
if (stream == null) return null;
|
if (stream == null) return null;
|
||||||
return new StreamStorage(stream, true).Slice(start, length);
|
return new StreamStorage(stream, true).Slice(start, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Storage AsStorage(this Stream stream, long start, int length, bool keepOpen)
|
||||||
|
{
|
||||||
|
if (stream == null) return null;
|
||||||
|
return new StreamStorage(stream, keepOpen).Slice(start, length);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue