generic group + wait instead of sleep

DKG
tzlil.gon 2016-04-08 15:04:07 +03:00
parent 0ae9719bc5
commit 5d564c834c
1 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,28 @@
package Utils;
import java.math.BigInteger;
/**
* Created by Tzlil on 4/7/2016.
*/
public class BigIntegerByteEncoder implements org.factcenter.qilin.util.ByteEncoder<BigInteger> {
@Override
public byte[] encode(BigInteger input) {
return input.toByteArray();
}
@Override
public BigInteger decode(byte[] input) {
return new BigInteger(1,input);
}
@Override
public int getMinLength() {
return 0;
}
@Override
public BigInteger denseDecode(byte[] input) {
return decode(input);
}
}