From 5d564c834c5b51970c82bda8f74573c4dce19995 Mon Sep 17 00:00:00 2001 From: "tzlil.gon" Date: Fri, 8 Apr 2016 15:04:07 +0300 Subject: [PATCH] generic group + wait instead of sleep --- .../java/Utils/BigIntegerByteEncoder.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 destributed-key-generation/src/test/java/Utils/BigIntegerByteEncoder.java diff --git a/destributed-key-generation/src/test/java/Utils/BigIntegerByteEncoder.java b/destributed-key-generation/src/test/java/Utils/BigIntegerByteEncoder.java new file mode 100644 index 0000000..a0c7107 --- /dev/null +++ b/destributed-key-generation/src/test/java/Utils/BigIntegerByteEncoder.java @@ -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 { + @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); + } +}