WhatsAppApi.Helper.IncompleteMessageException.setInput C# (CSharp) 메소드

setInput() 공개 메소드

public setInput ( string input ) : void
input string
리턴 void
        public void setInput(string input)
        {
            this.input = input;
        }

Usage Example

예제 #1
0
        public ProtocolTreeNode nextTree(byte[] pInput = null, bool useDecrypt = true)
        {
            if (pInput != null)
            {
                if (pInput.Length == 0)
                {
                    return(null);
                }
                this.buffer = new List <byte>();
                this.buffer.AddRange(pInput);
            }

            int stanzaFlag = (this.peekInt8() & 0xF0) >> 4;
            int stanzaSize = this.peekInt16(1);

            int flags = stanzaFlag;
            int size  = stanzaSize;

            if (stanzaSize > this.buffer.Count)
            {
                var exception = new IncompleteMessageException("Incomplete message");
                exception.setInput(this.buffer.ToArray());
                throw exception;
            }

            this.readInt24();

            bool isEncrypted = (stanzaFlag & 8) != 0;

            if (isEncrypted)
            {
                if (Encryptionkey != null)
                {
                    decode(size, useDecrypt);
                }
                else
                {
                    throw new Exception("Received encrypted message, encryption key not set");
                }
            }

            if (stanzaSize > 0)
            {
                ProtocolTreeNode node = this.nextTreeInternal();
                if (node != null)
                {
                    this.DebugPrint(node.NodeString("RECVD: "));
                }
                return(node);
            }
            return(null);
        }
All Usage Examples Of WhatsAppApi.Helper.IncompleteMessageException::setInput