Package net.tomp2p.peers

Examples of net.tomp2p.peers.Number160.toByteArray()


    }

  private void serializeFile(DataOutput out, Data value) throws IOException, FileNotFoundException {
      Number160 hash = value.hash();
      // store file name
      out.write(hash.toByteArray());
      // store as external file, create path
      RandomAccessFile file = null;
      FileChannel rwChannel = null;
      try {
        file = new RandomAccessFile(new File(path, hash.toString()), "rw");
View Full Code Here


        "0x7960941606812431931227086491591343621585");
    byte[] me = i1.toByteArray();
    Assert.assertEquals(i1, new Number160(me));
    me = i2.toByteArray();
    Assert.assertEquals(i2, new Number160(me));
    me = i3.toByteArray();
    byte[] me2 = new byte[20];
    System.arraycopy(me, 0, me2, me2.length - me.length, me.length);
    Assert.assertEquals(i3, new Number160(me2));
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.