StreamDecodingException.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using System;
  2. using System.Runtime.Serialization;
  3. namespace System.Net.ApiService.Compression.Exceptions {
  4. /// <summary>
  5. /// Indicates that an error occured during decoding of a input stream due to corrupt
  6. /// data or (unintentional) library incompability.
  7. /// </summary>
  8. [Serializable]
  9. public class StreamDecodingException : SharpZipBaseException
  10. {
  11. private const string GenericMessage = "Input stream could not be decoded";
  12. /// <summary>
  13. /// Initializes a new instance of the StreamDecodingException with a generic message
  14. /// </summary>
  15. public StreamDecodingException() : base(GenericMessage) { }
  16. /// <summary>
  17. /// Initializes a new instance of the StreamDecodingException class with a specified error message.
  18. /// </summary>
  19. /// <param name="message">A message describing the exception.</param>
  20. public StreamDecodingException(string message) : base(message) { }
  21. /// <summary>
  22. /// Initializes a new instance of the StreamDecodingException class with a specified
  23. /// error message and a reference to the inner exception that is the cause of this exception.
  24. /// </summary>
  25. /// <param name="message">A message describing the exception.</param>
  26. /// <param name="innerException">The inner exception</param>
  27. public StreamDecodingException(string message, Exception innerException) : base(message, innerException) { }
  28. /// <summary>
  29. /// Initializes a new instance of the StreamDecodingException class with serialized data.
  30. /// </summary>
  31. /// <param name="info">
  32. /// The System.Runtime.Serialization.SerializationInfo that holds the serialized
  33. /// object data about the exception being thrown.
  34. /// </param>
  35. /// <param name="context">
  36. /// The System.Runtime.Serialization.StreamingContext that contains contextual information
  37. /// about the source or destination.
  38. /// </param>
  39. protected StreamDecodingException(SerializationInfo info, StreamingContext context)
  40. : base(info, context)
  41. {
  42. }
  43. }
  44. }