// Path: src/main/java/org/cryptomator/cryptolib/api/Cryptor.java
// public interface Cryptor extends Destroyable, AutoCloseable {
// 
// 	FileContentCryptor fileContentCryptor();
// 
// 	FileHeaderCryptor fileHeaderCryptor();
// 
// 	FileNameCryptor fileNameCryptor();
// 
// 	@Override
// 	void destroy();
// 
// 	/**
// 	 * Calls {@link #destroy()}.
// 	 */
// 	@Override
// 	default void close() {
// 		destroy();
// 	}
// 
// }
// 
// Path: src/main/java/org/cryptomator/cryptolib/api/FileHeader.java
// public interface FileHeader {
// 
// 	/**
// 	 * Returns the value of a currently unused 64 bit field in the file header.
// 	 * <p>
// 	 * Formerly used for storing the plaintext file size.
// 	 *
// 	 * @return 64 bit integer for future use.
// 	 * @deprecated Don't rely on this method. It may be redefined any time.
// 	 */
// 	@Deprecated
// 	long getReserved();
// 
// 	/**
// 	 * Sets the 64 bit field in the file header.
// 	 * <p>
// 	 * Formerly used for storing the plaintext file size.
// 	 *
// 	 * @param reserved 64 bit integer for future use
// 	 * @deprecated Don't rely on this method. It may be redefined any time.
// 	 */
// 	@Deprecated
// 	void setReserved(long reserved);
// 
// }


import org.cryptomator.cryptolib.api.Cryptor;
import org.cryptomator.cryptolib.api.FileHeader;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.WritableByteChannel;
/*******************************************************************************
 * Copyright (c) 2016 Sebastian Stenzel and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the accompanying LICENSE.txt.
 *
 * Contributors:
 *     Sebastian Stenzel - initial API and implementation
 *******************************************************************************/
package org.cryptomator.cryptolib.common;



public class EncryptingWritableByteChannel implements WritableByteChannel {

	private final WritableByteChannel delegate;
// Path: src/main/java/org/cryptomator/cryptolib/api/Cryptor.java
// public interface Cryptor extends Destroyable, AutoCloseable {
// 
// 	FileContentCryptor fileContentCryptor();
// 
// 	FileHeaderCryptor fileHeaderCryptor();
// 
// 	FileNameCryptor fileNameCryptor();
// 
// 	@Override
// 	void destroy();
// 
// 	/**
// 	 * Calls {@link #destroy()}.
// 	 */
// 	@Override
// 	default void close() {
// 		destroy();
// 	}
// 
// }
// 
// Path: src/main/java/org/cryptomator/cryptolib/api/FileHeader.java
// public interface FileHeader {
// 
// 	/**
// 	 * Returns the value of a currently unused 64 bit field in the file header.
// 	 * <p>
// 	 * Formerly used for storing the plaintext file size.
// 	 *
// 	 * @return 64 bit integer for future use.
// 	 * @deprecated Don't rely on this method. It may be redefined any time.
// 	 */
// 	@Deprecated
// 	long getReserved();
// 
// 	/**
// 	 * Sets the 64 bit field in the file header.
// 	 * <p>
// 	 * Formerly used for storing the plaintext file size.
// 	 *
// 	 * @param reserved 64 bit integer for future use
// 	 * @deprecated Don't rely on this method. It may be redefined any time.
// 	 */
// 	@Deprecated
// 	void setReserved(long reserved);
// 
// }


// Path: src/main/java/org/cryptomator/cryptolib/common/EncryptingWritableByteChannel.java
import org.cryptomator.cryptolib.api.Cryptor;
import org.cryptomator.cryptolib.api.FileHeader;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.WritableByteChannel;

/*******************************************************************************
 * Copyright (c) 2016 Sebastian Stenzel and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the accompanying LICENSE.txt.
 *
 * Contributors:
 *     Sebastian Stenzel - initial API and implementation
 *******************************************************************************/
package org.cryptomator.cryptolib.common;



public class EncryptingWritableByteChannel implements WritableByteChannel {

	private final WritableByteChannel delegate;
	private final Cryptor cryptor;