Esempio n. 1
0
        static Exception GetError(LzmaReturn ret)
        {
            switch (ret)
            {
            case LzmaReturn.LzmaMemError: return(new InsufficientMemoryException("Memory allocation failed"));

            case LzmaReturn.LzmaOptionsError: return(new ArgumentException("Specified preset is not supported"));

            case LzmaReturn.LzmaUnsupportedCheck: return(new Exception("Specified integrity check is not supported"));

            case LzmaReturn.LzmaDataError: return(new InvalidDataException("File size limits exceeded"));

            default: return(new Exception("Unknown error, possibly a bug: " + ret));
            }
        }
Esempio n. 2
0
        static Exception GetDecodingError(LzmaReturn ret)
        {
            switch (ret)
            {
            case LzmaReturn.LzmaMemError: return(new InsufficientMemoryException("Memory allocation failed"));

            case LzmaReturn.LzmaFormatError: return(new InvalidDataException("The input is not in the .xz format"));

            case LzmaReturn.LzmaOptionsError: return(new Exception("Unsupported compression options"));

            case LzmaReturn.LzmaDataError: return(new InvalidDataException("Compressed file is corrupt"));

            case LzmaReturn.LzmaBufError: return(new InvalidDataException("Compressed file is truncated or otherwise corrupt"));

            default: return(new Exception("Unknown error, possibly a bug: " + ret));
            }
        }
Esempio n. 3
0
 Exception ThrowError(LzmaReturn ret)
 {
     Native.lzma_end(ref _lzmaStream);
     return(GetError(ret));
 }
Esempio n. 4
0
 static Exception IndexDecodingError(LzmaReturn ret) => new InvalidDataException("Index decoding failed: " + ret);