use of org.openecard.common.tlv.TLV in project open-ecard by ecsec.
the class ReadHelper method readCIAFile.
public static TLV readCIAFile(String name) throws IOException, TLVException {
String path = "/df.cia/" + name;
InputStream ins = ReadHelper.class.getResourceAsStream(path);
ByteArrayOutputStream outs = new ByteArrayOutputStream(ins.available());
int next;
while ((next = ins.read()) != -1) {
outs.write((byte) next);
}
byte[] resultBytes = outs.toByteArray();
TLV result = TLV.fromBER(resultBytes);
return result;
}
Aggregations