Coverage Summary for Class: ByteBufferUtil (co.rsk.util)
Class |
Class, %
|
Method, %
|
Line, %
|
ByteBufferUtil |
0%
(0/1)
|
0%
(0/3)
|
0%
(0/5)
|
1 package co.rsk.util;
2
3 import org.ethereum.util.ByteUtil;
4
5 import javax.annotation.Nonnull;
6 import java.nio.ByteBuffer;
7
8 public class ByteBufferUtil {
9 public static byte[] copyToArray(@Nonnull ByteBuffer data) {
10 byte[] copy = new byte[data.remaining()];
11 data.duplicate().get(copy);
12 return copy;
13 }
14
15 public static String toHexString(@Nonnull ByteBuffer data) {
16 return ByteUtil.toHexString(copyToArray(data));
17 }
18 }