home *** CD-ROM | disk | FTP | other *** search
- package javax.crypto;
-
- import java.io.FilterOutputStream;
- import java.io.IOException;
- import java.io.OutputStream;
-
- public class CipherOutputStream extends FilterOutputStream {
- // $FF: renamed from: a javax.crypto.Cipher
- private Cipher field_0;
- // $FF: renamed from: b java.io.OutputStream
- private OutputStream field_1;
- // $FF: renamed from: c byte[]
- private byte[] field_2 = new byte[1];
- // $FF: renamed from: d byte[]
- private byte[] field_3;
-
- public CipherOutputStream(OutputStream var1, Cipher var2) {
- super(var1);
- this.field_1 = var1;
- this.field_0 = var2;
- }
-
- protected CipherOutputStream(OutputStream var1) {
- super(var1);
- this.field_1 = var1;
- this.field_0 = new NullCipher();
- }
-
- public void write(int var1) throws IOException {
- this.field_2[0] = (byte)var1;
- this.field_3 = this.field_0.update(this.field_2, 0, 1);
- if (this.field_3 != null) {
- this.field_1.write(this.field_3);
- this.field_3 = null;
- }
-
- }
-
- public void write(byte[] var1) throws IOException {
- this.write(var1, 0, var1.length);
- }
-
- public void write(byte[] var1, int var2, int var3) throws IOException {
- this.field_3 = this.field_0.update(var1, var2, var3);
- if (this.field_3 != null) {
- this.field_1.write(this.field_3);
- this.field_3 = null;
- }
-
- }
-
- public void flush() throws IOException {
- if (this.field_3 != null) {
- this.field_1.write(this.field_3);
- this.field_3 = null;
- }
-
- this.field_1.flush();
- }
-
- public void close() throws IOException {
- try {
- this.field_3 = this.field_0.doFinal();
- } catch (IllegalBlockSizeException var3) {
- this.field_3 = null;
- } catch (BadPaddingException var4) {
- this.field_3 = null;
- }
-
- try {
- this.flush();
- } catch (IOException var2) {
- }
-
- super.out.close();
- }
- }
-