public static cape.SizedReader create(cape.SizedReader reader, capex.crypto.BlockCipher cipher)
        {
            if (reader == null)
            {
                return(null);
            }
            if (cipher == null)
            {
                return(reader);
            }
            var v = new capex.crypto.BlockCipherReader();

            v.reader   = reader;
            v.cipher   = cipher;
            v.bcurrent = cape.Buffer.allocate((long)cipher.getBlockSize());
            v.bnext    = cape.Buffer.allocate((long)cipher.getBlockSize());
            v.ddata    = cape.Buffer.allocate((long)cipher.getBlockSize());
            v.csize    = 0;
            v.cindex   = 0;
            v.nsize    = 0;
            return((cape.SizedReader)v);
        }
Exemplo n.º 2
0
        public static capex.http.HTTPClientRequest forPOST(string url, string mimeType, cape.SizedReader data)
        {
            var v = new capex.http.HTTPClientRequest();

            v.setMethod("POST");
            v.setUrl(url);
            if (cape.String.isEmpty(mimeType) == false)
            {
                v.addHeader("Content-Type", mimeType);
            }
            if (data != null)
            {
                v.setBody(data);
            }
            return(v);
        }
Exemplo n.º 3
0
 public capex.http.HTTPClientRequest setBody(cape.SizedReader v)
 {
     body = v;
     return(this);
 }