-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2f7973c
commit f6f8362
Showing
331 changed files
with
4,896 additions
and
5,463 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace ITHit.FileSystem.Samples.Common | ||
{ | ||
/// <summary> | ||
/// Stream helper functions. | ||
/// </summary> | ||
public static class StreamCopy | ||
{ | ||
|
||
/// <summary> | ||
/// Asynchronously copies specified number of bytes from current stream to destination stream, using a specified buffer size. | ||
/// </summary> | ||
/// <param name="source">Source stream.</param> | ||
/// <param name="destination">The stream to which the contents of the current file stream will be copied.</param> | ||
/// <param name="bufferSize">The size, in bytes, of the buffer. This value must be greater than zero.</param> | ||
/// <param name="count">Number of bytes to copy.</param> | ||
public static async Task CopyToAsync(this Stream source, Stream destination, int bufferSize, long count) | ||
{ | ||
byte[] buffer = new byte[bufferSize]; | ||
int read; | ||
while (count > 0 | ||
&& (read = await source.ReadAsync(buffer, 0, (int)Math.Min(buffer.LongLength, count))) > 0) | ||
{ | ||
await destination.WriteAsync(buffer, 0, read); | ||
count -= read; | ||
} | ||
} | ||
} | ||
} |
File renamed without changes.
46 changes: 0 additions & 46 deletions
46
ITHit.FileSystem.Samples.Common.Windows/ClientLockFailedException.cs
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.