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
/// <summary> | |
/// Adds more memory-friendly IEnumerable versions of String.Split() | |
/// </summary> | |
[EditorBrowsable(EditorBrowsableState.Never)] | |
public static class StringSplitExtensions | |
{ | |
/// <summary> | |
/// Returns a string array that contains the substrings in this instance that are delimited by elements of a specified Unicode character array. | |
/// </summary> | |
/// <param name="separator"></param> |
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
public static IEnumerable<byte[]> LazyReadBinaryFile(string fileName, int recordLen) | |
{ | |
byte[] buffer = new byte[recordLen]; | |
using (var stream = File.OpenRead(fileName)) | |
{ | |
long remaining = stream.Length; | |
int read = 0; | |
while (remaining > 0) | |
{ |
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
/// <summary> | |
/// Provides extension methods for executing sequences of async operations. | |
/// Items flow into the resulting sequence as they complete, with the specified limit of operations executing concurrently | |
/// </summary> | |
public static class AsyncOpLinqExtension | |
{ | |
/// <summary> | |
/// executes <paramref name="action"/> over each element of <paramref name="source"/> | |
/// </summary> | |
/// <typeparam name="TSource">type of input sequence</typeparam> |
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
public sealed class CustomFormatConverter<T> : ConverterBase where T : IFormattable | |
{ | |
private string _formatString; | |
private IFormatProvider _formatProvider; | |
private Type _objType; | |
#region constructors | |
public CustomFormatConverter(string Format) | |
: this(Format, null) | |
{ } |