Java Encrypt Byte Array encryptL(byte[] bytes, int length)

Here you can find the source of encryptL(byte[] bytes, int length)

Description

encrypt L

License

Apache License

Declaration

public static void encryptL(byte[] bytes, int length) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public class Main {
    public static void encryptL(byte[] bytes, int length) {
        for (int i = 0; i < bytes.length; i++) {
            bytes[i] = (byte) (bytes[i] + 29);
        }/*  w  w  w  .j  a v  a2s  . c  o  m*/
    }

    public static void encryptL(InputStream in, OutputStream out) throws IOException {
        int bufferSize = 8192;
        byte[] buffer = new byte[bufferSize];
        for (int read; (read = in.read(buffer, 0, bufferSize)) > -1;) {
            encryptL(buffer, read);
            out.write(buffer, 0, read);
        }
    }
}

Related

  1. encrypt(byte[] data, byte[] key)
  2. encryptRaw(byte[] key, byte[] b)