Examples of ByteSource


Examples of org.apache.shiro.util.ByteSource

        byte[] key = blowfish.generateNewKey().getEncoded();

        for (String plain : PLAINTEXTS) {
            byte[] plaintext = CodecSupport.toBytes(plain);
            ByteSource ciphertext = blowfish.encrypt(plaintext, key);
            ByteSource decrypted = blowfish.decrypt(ciphertext.getBytes(), key);
            assertTrue(Arrays.equals(plaintext, decrypted.getBytes()));
        }
    }
View Full Code Here

Examples of org.apache.shiro.util.ByteSource

        byte[] key = aes.generateNewKey().getEncoded();

        for (String plain : PLAINTEXTS) {
            byte[] plaintext = CodecSupport.toBytes(plain);
            ByteSource ciphertext = aes.encrypt(plaintext, key);
            ByteSource decrypted = aes.decrypt(ciphertext.getBytes(), key);
            assertTrue(Arrays.equals(plaintext, decrypted.getBytes()));
        }
    }
View Full Code Here

Examples of org.milyn.payload.ByteSource

        ServiceInvoker invoker = new ServiceInvoker("Transform", "String");
        Message message = MessageFactory.getInstance().getMessage();
        SourceResult sourceResult = new SourceResult();
        StringResult result = new StringResult();

        sourceResult.setSource(new ByteSource(personXmlBytes));
        sourceResult.setResult(result);

        message.getBody().add(sourceResult);
        message = invoker.deliverSync(message, 30000);
View Full Code Here

Examples of org.nustaq.offheap.bytez.ByteSource

            tim = System.currentTimeMillis();
            Iterator<ByteSource> bvalues = store.binaryValues();
            iterCnt = 0;
            while( bvalues.hasNext() ) {
                ByteSource read = bvalues.next();
                if ( read == null ) {
                    System.out.println("ERROR");
                }
                iterCnt++;
            }
View Full Code Here

Examples of org.zeroturnaround.zip.ByteSource

   */
  public void transform(InputStream in, ZipEntry zipEntry, ZipOutputStream out) throws IOException {
    byte[] bytes = IOUtils.toByteArray(in);
    bytes = transform(zipEntry, bytes);

    ByteSource source;

    if (preserveTimestamps()) {
      source = new ByteSource(zipEntry.getName(), bytes, zipEntry.getTime());
    }
    else {
      source = new ByteSource(zipEntry.getName(), bytes);
    }

    ZipEntrySourceZipEntryTransformer.addEntry(source, out);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.