public class Utils extends Object
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
bestEffortclose(Closeable... closables) |
static int |
byteArrayToInt(byte[] b) |
static byte[] |
compress(byte[] input) |
static Number160 |
createRandomNodeID() |
static Object |
decodeJavaObject(byte[] me,
int offset,
int length) |
static void |
difference(Collection<PeerAddress> newNeighbors,
Collection<PeerAddress> alreadyAsked,
Collection<PeerAddress> result) |
static DigestInfo |
digest(Storage storage,
Number160 locationKey,
Number160 domainKey,
Collection<Number160> contentKeys) |
static byte[] |
encodeJavaObject(Object attachement) |
static byte[] |
intToByteArray(int value) |
static ByteBuffer |
loadFile(File file) |
static Number160 |
makeSHAHash(byte[] buffer) |
static Number160 |
makeSHAHash(byte[] buffer,
int offset,
int length) |
static Number160 |
makeSHAHash(ByteBuffer buffer) |
static Number160 |
makeSHAHash(File file) |
static Number160 |
makeSHAHash(String strInput) |
static PeerAddress |
pollFirst(SortedSet<PeerAddress> queue) |
static void |
sleep(long connectionTimeout) |
static byte[] |
uncompress(byte[] compressedData) |
static byte[] |
uncompress(byte[] compressedData,
int offset,
int length) |
public static ByteBuffer loadFile(File file) throws IOException
IOExceptionpublic static Number160 makeSHAHash(ByteBuffer buffer)
public static Number160 makeSHAHash(byte[] buffer)
public static Number160 makeSHAHash(byte[] buffer, int offset, int length)
public static Number160 createRandomNodeID()
public static void sleep(long connectionTimeout)
public static byte[] compress(byte[] input)
public static byte[] uncompress(byte[] compressedData,
int offset,
int length)
public static byte[] uncompress(byte[] compressedData)
public static byte[] encodeJavaObject(Object attachement) throws IOException
IOExceptionpublic static Object decodeJavaObject(byte[] me, int offset, int length) throws ClassNotFoundException, IOException
ClassNotFoundExceptionIOExceptionpublic static void difference(Collection<PeerAddress> newNeighbors, Collection<PeerAddress> alreadyAsked, Collection<PeerAddress> result)
public static void bestEffortclose(Closeable... closables)
public static PeerAddress pollFirst(SortedSet<PeerAddress> queue)
public static final byte[] intToByteArray(int value)
public static final int byteArrayToInt(byte[] b)
public static DigestInfo digest(Storage storage, Number160 locationKey, Number160 domainKey, Collection<Number160> contentKeys)
Copyright © 2011. All Rights Reserved.