/** * This will encrypt and write the data. * * @param data The data to encrypt. * @param output The stream to write to. * * @throws IOException If there is an error writing to the output stream. */ public void write( byte[] data, OutputStream output ) throws IOException { for (byte aData : data) { write(aData, output); } }
/** * This will encrypt and write the data. * * @param data The data to encrypt. * @param offset The offset into the array to start reading data from. * @param len The number of bytes to attempt to read. * @param output The stream to write to. * * @throws IOException If there is an error writing to the output stream. */ public void write( byte[] data, int offset, int len, OutputStream output) throws IOException { for( int i = offset; i < offset + len; i++ ) { write( data[i], output ); } } }
/** * This will encrypt and write the data. * * @param data The data to encrypt. * @param output The stream to write to. * * @throws IOException If there is an error writing to the output stream. */ public void write( InputStream data, OutputStream output ) throws IOException { byte[] buffer = new byte[1024]; int amountRead; while( (amountRead = data.read( buffer )) != -1 ) { write( buffer, 0, amountRead, output ); } }
/** * Encrypt or decrypt data with RC4. * * @param finalKey The final key obtained with via {@link #calcFinalKey(long, long)}. * @param input The data to encrypt. * @param output The output to write the encrypted data to. * * @throws IOException If there is an error reading the data. */ protected void encryptDataRC4(byte[] finalKey, byte[] input, OutputStream output) throws IOException { rc4.setKey(finalKey); rc4.write(input, output); }
/** * Encrypt or decrypt data with RC4. * * @param finalKey The final key obtained with via {@link #calcFinalKey(long, long)}. * @param input The data to encrypt. * @param output The output to write the encrypted data to. * * @throws IOException If there is an error reading the data. */ protected void encryptDataRC4(byte[] finalKey, InputStream input, OutputStream output) throws IOException { rc4.setKey(finalKey); rc4.write(input, output); }
/** * This will encrypt and write the data. * * @param data The data to encrypt. * @param output The stream to write to. * * @throws IOException If there is an error writing to the output stream. */ public void write( byte[] data, OutputStream output ) throws IOException { for (byte aData : data) { write(aData, output); } }
/** * This will encrypt and write the data. * * @param data The data to encrypt. * @param output The stream to write to. * * @throws IOException If there is an error writing to the output stream. */ public void write( byte[] data, OutputStream output ) throws IOException { for (byte aData : data) { write(aData, output); } }
/** * This will encrypt and write the data. * * @param data The data to encrypt. * @param offset The offset into the array to start reading data from. * @param len The number of bytes to attempt to read. * @param output The stream to write to. * * @throws IOException If there is an error writing to the output stream. */ public void write( byte[] data, int offset, int len, OutputStream output) throws IOException { for( int i = offset; i < offset + len; i++ ) { write( data[i], output ); } } }
/** * This will encrypt and write the data. * * @param data The data to encrypt. * @param offset The offset into the array to start reading data from. * @param len The number of bytes to attempt to read. * @param output The stream to write to. * * @throws IOException If there is an error writing to the output stream. */ public void write( byte[] data, int offset, int len, OutputStream output) throws IOException { for( int i = offset; i < offset + len; i++ ) { write( data[i], output ); } } }
/** * This will encrypt and write the data. * * @param data The data to encrypt. * @param output The stream to write to. * * @throws IOException If there is an error writing to the output stream. */ public void write( InputStream data, OutputStream output ) throws IOException { byte[] buffer = new byte[1024]; int amountRead; while( (amountRead = data.read( buffer )) != -1 ) { write( buffer, 0, amountRead, output ); } }
/** * This will encrypt and write the data. * * @param data The data to encrypt. * @param output The stream to write to. * * @throws IOException If there is an error writing to the output stream. */ public void write( InputStream data, OutputStream output ) throws IOException { byte[] buffer = new byte[1024]; int amountRead; while( (amountRead = data.read( buffer )) != -1 ) { write( buffer, 0, amountRead, output ); } }
/** * Encrypt or decrypt data with RC4. * * @param finalKey The final key obtained with via {@link #calcFinalKey(long, long)}. * @param input The data to encrypt. * @param output The output to write the encrypted data to. * * @throws IOException If there is an error reading the data. */ protected void encryptDataRC4(byte[] finalKey, byte[] input, OutputStream output) throws IOException { rc4.setKey(finalKey); rc4.write(input, output); }
/** * Encrypt or decrypt data with RC4. * * @param finalKey The final key obtained with via {@link #calcFinalKey(long, long)}. * @param input The data to encrypt. * @param output The output to write the encrypted data to. * * @throws IOException If there is an error reading the data. */ protected void encryptDataRC4(byte[] finalKey, byte[] input, OutputStream output) throws IOException { rc4.setKey(finalKey); rc4.write(input, output); }
/** * Encrypt or decrypt data with RC4. * * @param finalKey The final key obtained with via {@link #calcFinalKey(long, long)}. * @param input The data to encrypt. * @param output The output to write the encrypted data to. * * @throws IOException If there is an error reading the data. */ protected void encryptDataRC4(byte[] finalKey, InputStream input, OutputStream output) throws IOException { rc4.setKey(finalKey); rc4.write(input, output); }
/** * Encrypt or decrypt data with RC4. * * @param finalKey The final key obtained with via {@link #calcFinalKey(long, long)}. * @param input The data to encrypt. * @param output The output to write the encrypted data to. * * @throws IOException If there is an error reading the data. */ protected void encryptDataRC4(byte[] finalKey, InputStream input, OutputStream output) throws IOException { rc4.setKey(finalKey); rc4.write(input, output); }