示例#1
0
            public string GetErrorMessage()
            {
                // This can work even after XxflateEnd().

                if (ZNullPtr.Equals(zStreamPtr->msg))
                {
                    return(String.Empty);
                }

                String msgStr = new String((SByte *)zStreamPtr->msg);

                return(msgStr);
            }
示例#2
0
            public string GetErrorMessage()
            {
                // This can work even after XxflateEnd().

                if (ZNullPtr.Equals(_zStream.msg))
                {
                    return(String.Empty);
                }

                unsafe
                {
                    StringBuilder sb       = new StringBuilder();
                    SByte *       pMessage = (SByte *)_zStream.msg;
                    char          c;
                    do
                    {
                        c = (char)*pMessage;
                        pMessage++;
                        sb.Append(c);
                    } while ((sbyte)c != 0);

                    return(sb.ToString());
                }
            }