using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
using System.Threading;
using System.Security.Cryptography;
using System.Diagnostics;
namespace Renci.SshNet
{
///
/// Collection of different extension method specific for .NET 3.5
///
public static partial class Extensions
{
///
/// Disposes the specified socket.
///
/// The socket.
[DebuggerNonUserCode]
internal static void Dispose(this Socket socket)
{
if (socket == null)
throw new NullReferenceException();
socket.Close();
}
///
/// Disposes the specified handle.
///
/// The handle.
[DebuggerNonUserCode]
internal static void Dispose(this WaitHandle handle)
{
if (handle == null)
throw new NullReferenceException();
handle.Close();
}
///
/// Disposes the specified algorithm.
///
/// The algorithm.
[DebuggerNonUserCode]
internal static void Dispose(this HashAlgorithm algorithm)
{
if (algorithm == null)
throw new NullReferenceException();
algorithm.Clear();
}
///
/// Clears the contents of the string builder.
///
///
/// The to clear.
///
public static void Clear(this StringBuilder value)
{
value.Length = 0;
value.Capacity = 16;
}
}
}