IBlockResult.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Crypto
  5. {
  6. /// <summary>
  7. /// Operators that reduce their input to a single block return an object
  8. /// of this type.
  9. /// </summary>
  10. public interface IBlockResult
  11. {
  12. /// <summary>
  13. /// Return the final result of the operation.
  14. /// </summary>
  15. /// <returns>A block of bytes, representing the result of an operation.</returns>
  16. byte[] Collect();
  17. /// <summary>
  18. /// Store the final result of the operation by copying it into the destination array.
  19. /// </summary>
  20. /// <returns>The number of bytes copied into destination.</returns>
  21. /// <param name="destination">The byte array to copy the result into.</param>
  22. /// <param name="offset">The offset into destination to start copying the result at.</param>
  23. int Collect(byte[] destination, int offset);
  24. #if NETCOREAPP2_1_OR_GREATER || NETSTANDARD2_1_OR_GREATER || UNITY_2021_2_OR_NEWER
  25. /// <summary>
  26. /// Store the final result of the operation by copying it into the destination span.
  27. /// </summary>
  28. /// <returns>The number of bytes copied into destination.</returns>
  29. /// <param name="destination">The span to copy the result into.</param>
  30. int Collect(Span<byte> destination);
  31. #endif
  32. }
  33. }
  34. #pragma warning restore
  35. #endif