use of net.java.otr4j.io.OtrInputStream in project Zom-Android by zom.
the class SM method unserialize.
public static BigInteger[] unserialize(byte[] bytes) throws SMException {
try {
ByteArrayInputStream in = new ByteArrayInputStream(bytes);
OtrInputStream ois = new OtrInputStream(in);
int len = ois.readInt();
if (len > 100) {
ois.close();
throw new SMException("Too many ints");
}
BigInteger[] ints = new BigInteger[len];
for (int i = 0; i < len; i++) {
ints[i] = ois.readBigInt();
}
ois.close();
return ints;
} catch (IOException ex) {
throw new SMException("cannot unserialize bigints");
}
}
Aggregations