@Test public void testDecode() throws Exception { assertNotNull(NodeIdConv.decode(null)); assertNotNull(NodeIdConv.decode(new byte[]{})); assertEquals(nodeIds1, NodeIdConv.decode(new byte[]{127, 0, 0, 1, 0, 0, 0, 1, 127, 124, 56, 1})); assertNotEquals(nodeIds2, NodeIdConv.decode(new byte[]{127, 0, 0, 1, 0, 0, 0, 1, 127, 124, 56, 1})); }
public static List<NodeId> decode(byte[] array) throws UnknownHostException, UnknownNodeIdException { List<NodeId> nodesIds = new ArrayList<>(); while (array != null && array.length != 0) { NodeId nodeId = _decode(array); nodesIds.add(nodeId); array = ArraysUtil.readBytes(array, IpPrefixConv.getBytesLength(32)); } return nodesIds; }
NodeIdConv { public static List<NodeId> decode(byte[] array) throws UnknownHostException, UnknownNodeIdException { List<NodeId> nodesIds = new ArrayList<>(); while (array != null && array.length != 0) { NodeId nodeId = _decode(array); nodesIds.add(nodeId); array = ArraysUtil.readBytes(array, IpPrefixConv.getBytesLength(32)); } return nodesIds; } }
NodeIdConv { public static List<NodeId> decode(byte[] array) throws UnknownHostException, UnknownNodeIdException { List<NodeId> nodesIds = new ArrayList<>(); while (array != null && array.length != 0) { NodeId nodeId = _decode(array); nodesIds.add(nodeId); array = ArraysUtil.readBytes(array, IpPrefixConv.getBytesLength(32)); } return nodesIds; } private  NodeIdConv(); }
NodeIdConv { public static List<NodeId> decode(byte[] array) throws UnknownHostException, UnknownNodeIdException { List<NodeId> nodesIds = new ArrayList<>(); while (array != null && array.length != 0) { NodeId nodeId = _decode(array); nodesIds.add(nodeId); array = ArraysUtil.readBytes(array, IpPrefixConv.getBytesLength(32)); } return nodesIds; } private  NodeIdConv(); static NodeId _decode(byte[] array); static NodeId create(int nodeId); static NodeId createNodeId(InetAddress inetAddress); static NodeId createNodeId(String prefix); static PeerSequence createPeerSequence(List<NodeId> nodeIds); static List<NodeId> decode(byte[] array); static boolean equalTo(NodeId nodeId1, NodeId nodeId2); static List<NodeId> getPeerSequence(PeerSequence peerSequence); static byte[] toBytes(List<NodeId> nodesIds); static byte[] toBytes(NodeId nodeId); static String toString(NodeId nodeId); static String toString(PeerSequence peerSequence); }
NodeIdConv { public static List<NodeId> decode(byte[] array) throws UnknownHostException, UnknownNodeIdException { List<NodeId> nodesIds = new ArrayList<>(); while (array != null && array.length != 0) { NodeId nodeId = _decode(array); nodesIds.add(nodeId); array = ArraysUtil.readBytes(array, IpPrefixConv.getBytesLength(32)); } return nodesIds; } private  NodeIdConv(); static NodeId _decode(byte[] array); static NodeId create(int nodeId); static NodeId createNodeId(InetAddress inetAddress); static NodeId createNodeId(String prefix); static PeerSequence createPeerSequence(List<NodeId> nodeIds); static List<NodeId> decode(byte[] array); static boolean equalTo(NodeId nodeId1, NodeId nodeId2); static List<NodeId> getPeerSequence(PeerSequence peerSequence); static byte[] toBytes(List<NodeId> nodesIds); static byte[] toBytes(NodeId nodeId); static String toString(NodeId nodeId); static String toString(PeerSequence peerSequence);  }