Ejemplo n.º 1
0
 private static bool ZTryAsLiteral(IList <byte> pBytes, bool pSecret, bool pEncoded, out cLiteralCommandPart rResult)
 {
     if (pBytes == null)
     {
         rResult = null; return(false);
     }
     foreach (byte lByte in pBytes)
     {
         if (lByte == cASCII.NUL)
         {
             rResult = null; return(false);
         }
     }
     rResult = new cLiteralCommandPart(pBytes, false, pSecret, pEncoded);
     return(true);
 }
Ejemplo n.º 2
0
        public static bool TryAsASCIILiteral(string pString, bool pSecret, out cLiteralCommandPart rResult)
        {
            if (pString == null)
            {
                rResult = null; return(false);
            }

            var lBytes = new cByteList(pString.Length);

            foreach (char lChar in pString)
            {
                if (lChar == cChar.NUL || lChar > cChar.DEL)
                {
                    rResult = null; return(false);
                }
                lBytes.Add((byte)lChar);
            }

            rResult = new cLiteralCommandPart(lBytes, false, pSecret);
            return(true);
        }