#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
#pragma warning disable
using System;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto
{
///
/// A simple block result object which just carries a byte array.
///
public class SimpleBlockResult
: IBlockResult
{
private readonly byte[] result;
///
/// Base constructor - a wrapper for the passed in byte array.
///
/// The byte array to be wrapped.
public SimpleBlockResult(byte[] result)
{
this.result = result;
}
///
/// Return the number of bytes in the result
///
/// The length of the result in bytes.
public int Length
{
get { return result.Length; }
}
///
/// Return the final result of the operation.
///
/// A block of bytes, representing the result of an operation.
public byte[] Collect()
{
return result;
}
///
/// Store the final result of the operation by copying it into the destination array.
///
/// The number of bytes copied into destination.
/// The byte array to copy the result into.
/// The offset into destination to start copying the result at.
public int Collect(byte[] destination, int offset)
{
Array.Copy(result, 0, destination, offset, result.Length);
return result.Length;
}
}
}
#pragma warning restore
#endif