IEncoder.cs 844 B

123456789101112131415161718192021222324252627282930
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. using System.IO;
  5. namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders
  6. {
  7. /**
  8. * Encode and decode byte arrays (typically from binary to 7-bit ASCII
  9. * encodings).
  10. */
  11. public interface IEncoder
  12. {
  13. int Encode(byte[] data, int off, int length, Stream outStream);
  14. #if NETCOREAPP2_1_OR_GREATER || NETSTANDARD2_1_OR_GREATER || UNITY_2021_2_OR_NEWER
  15. int Encode(ReadOnlySpan<byte> data, Stream outStream);
  16. #endif
  17. int Decode(byte[] data, int off, int length, Stream outStream);
  18. #if NETCOREAPP2_1_OR_GREATER || NETSTANDARD2_1_OR_GREATER || UNITY_2021_2_OR_NEWER
  19. int Decode(ReadOnlySpan<byte> data, Stream outStream);
  20. #endif
  21. int DecodeString(string data, Stream outStream);
  22. }
  23. }
  24. #pragma warning restore
  25. #endif