home *** CD-ROM | disk | FTP | other *** search
- package javax.crypto;
-
- import java.io.FilterInputStream;
- import java.io.IOException;
- import java.io.InputStream;
-
- public class CipherInputStream extends FilterInputStream {
- // $FF: renamed from: a javax.crypto.Cipher
- private Cipher field_0;
- // $FF: renamed from: b java.io.InputStream
- private InputStream field_1;
- // $FF: renamed from: c byte[]
- private byte[] field_2 = new byte[512];
- // $FF: renamed from: d boolean
- private boolean field_3 = false;
- // $FF: renamed from: e byte[]
- private byte[] field_4;
- // $FF: renamed from: f int
- private int field_5 = 0;
- // $FF: renamed from: g int
- private int field_6 = 0;
-
- // $FF: renamed from: a () int
- private int method_0() throws IOException {
- if (this.field_3) {
- return -1;
- } else {
- int var1 = this.field_1.read(this.field_2);
- if (var1 == -1) {
- this.field_3 = true;
-
- try {
- this.field_4 = this.field_0.doFinal();
- } catch (IllegalBlockSizeException var3) {
- this.field_4 = null;
- } catch (BadPaddingException var4) {
- this.field_4 = null;
- }
-
- if (this.field_4 == null) {
- return -1;
- } else {
- this.field_5 = 0;
- this.field_6 = this.field_4.length;
- return this.field_6;
- }
- } else {
- try {
- this.field_4 = this.field_0.update(this.field_2, 0, var1);
- } catch (IllegalStateException var5) {
- this.field_4 = null;
- }
-
- this.field_5 = 0;
- if (this.field_4 == null) {
- this.field_6 = 0;
- } else {
- this.field_6 = this.field_4.length;
- }
-
- return this.field_6;
- }
- }
- }
-
- public CipherInputStream(InputStream var1, Cipher var2) {
- super(var1);
- this.field_1 = var1;
- this.field_0 = var2;
- }
-
- protected CipherInputStream(InputStream var1) {
- super(var1);
- this.field_1 = var1;
- this.field_0 = new NullCipher();
- }
-
- public int read() throws IOException {
- if (this.field_5 >= this.field_6) {
- int var1;
- for(var1 = 0; var1 == 0; var1 = this.method_0()) {
- }
-
- if (var1 == -1) {
- return -1;
- }
- }
-
- return this.field_4[this.field_5++] & 255;
- }
-
- public int read(byte[] var1) throws IOException {
- return this.read(var1, 0, var1.length);
- }
-
- public int read(byte[] var1, int var2, int var3) throws IOException {
- if (this.field_5 >= this.field_6) {
- int var4;
- for(var4 = 0; var4 == 0; var4 = this.method_0()) {
- }
-
- if (var4 == -1) {
- return -1;
- }
- }
-
- if (var3 <= 0) {
- return 0;
- } else {
- int var5 = this.field_6 - this.field_5;
- if (var3 < var5) {
- var5 = var3;
- }
-
- if (var1 != null) {
- System.arraycopy(this.field_4, this.field_5, var1, var2, var5);
- }
-
- this.field_5 += var5;
- return var5;
- }
- }
-
- public long skip(long var1) throws IOException {
- int var3 = this.field_6 - this.field_5;
- if (var1 > (long)var3) {
- var1 = (long)var3;
- }
-
- if (var1 < 0L) {
- return 0L;
- } else {
- this.field_5 = (int)((long)this.field_5 + var1);
- return var1;
- }
- }
-
- public int available() throws IOException {
- return this.field_6 - this.field_5;
- }
-
- public void close() throws IOException {
- this.field_1.close();
-
- try {
- this.field_0.doFinal();
- } catch (BadPaddingException var2) {
- } catch (IllegalBlockSizeException var3) {
- }
-
- this.field_5 = 0;
- this.field_6 = 0;
- }
-
- public boolean markSupported() {
- return false;
- }
- }
-