generic group + wait instead of sleep
parent
0ae9719bc5
commit
5d564c834c
|
@ -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);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue