示例#1
0
 public static byte[] getNBOHost(String h) {
   if (h.equals(PEER)) return null;
   byte hostBytes[] = h.getBytes();
   int len = Array.getLength(hostBytes);
   ByteBuffer buf = ByteBuffer.allocate(len);
   buf.put(hostBytes);
   buf.order(ByteOrder.BIG_ENDIAN);
   buf.rewind();
   return (buf.array());
 }