what-the-bank/sources/org/jmrtd/lds/icao/DG1File.java

81 lines
2.7 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package org.jmrtd.lds.icao;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import net.sf.scuba.tlv.TLVInputStream;
import net.sf.scuba.tlv.TLVOutputStream;
import o.C15109ghW;
import org.jmrtd.lds.DataGroup;
/* loaded from: classes6.dex */
public class DG1File extends DataGroup {
private static final short MRZ_INFO_TAG = 24351;
private static final long serialVersionUID = 5091606125728809058L;
private MRZInfo mrzInfo;
public DG1File(MRZInfo mRZInfo) {
super(97);
this.mrzInfo = mRZInfo;
}
public DG1File(InputStream inputStream) throws IOException {
super(97, inputStream);
}
@Override // org.jmrtd.lds.AbstractTaggedLDSFile
public void readContent(InputStream inputStream) throws IOException {
TLVInputStream tLVInputStream = inputStream instanceof TLVInputStream ? (TLVInputStream) inputStream : new TLVInputStream(inputStream);
while (true) {
if (!tLVInputStream.c.b) {
if (tLVInputStream.c.a) {
tLVInputStream.c();
if (C15109ghW.c(tLVInputStream.c.e())) {
tLVInputStream.a();
}
} else if (C15109ghW.c(tLVInputStream.c.e())) {
tLVInputStream.a();
}
}
int b = tLVInputStream.b();
if (b == 24351) {
break;
} else if (C15109ghW.c(b)) {
if (((int) tLVInputStream.a()) < tLVInputStream.c()) {
break;
}
}
}
this.mrzInfo = new MRZInfo(tLVInputStream, tLVInputStream.c());
}
@Override // org.jmrtd.lds.DataGroup, org.jmrtd.lds.AbstractTaggedLDSFile
public String toString() {
StringBuilder sb = new StringBuilder("DG1File ");
sb.append(this.mrzInfo.toString().replaceAll("\n", "").trim());
return sb.toString();
}
public boolean equals(Object obj) {
if (obj != null && obj.getClass().equals(getClass())) {
return this.mrzInfo.equals(((DG1File) obj).mrzInfo);
}
return false;
}
public int hashCode() {
return (this.mrzInfo.hashCode() * 3) + 57;
}
@Override // org.jmrtd.lds.AbstractTaggedLDSFile
public void writeContent(OutputStream outputStream) throws IOException {
TLVOutputStream tLVOutputStream = outputStream instanceof TLVOutputStream ? (TLVOutputStream) outputStream : new TLVOutputStream(outputStream);
tLVOutputStream.d(24351);
tLVOutputStream.d(this.mrzInfo.getEncoded());
}
public MRZInfo getMRZInfo() {
return this.mrzInfo;
}
}