|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectudt.util.Util
public class Util
helper methods
| Field Summary | |
|---|---|
static long |
SYN
|
static double |
SYN_D
|
| Constructor Summary | |
|---|---|
Util()
|
|
| Method Summary | |
|---|---|
static void |
copy(InputStream source,
OutputStream target)
copy input data from the source stream to the target stream |
static void |
copy(InputStream source,
OutputStream target,
long size,
boolean flush)
copy input data from the source stream to the target stream |
static void |
doHolePunch(UDPEndPoint endpoint,
InetAddress client,
int clientPort)
perform UDP hole punching to the specified client by sending a dummy packet. |
static long |
getCurrentTime()
get the current timer value in microseconds |
static long |
getSYNTime()
get the SYN time in microseconds. |
static double |
getSYNTimeD()
|
static double |
getSYNTimeSeconds()
get the SYN time in seconds. |
static String |
hexString(MessageDigest digest)
|
static String |
readLine(InputStream input)
read a line terminated by a new line '\n' character |
static String |
readLine(InputStream input,
char terminatorChar)
read a line from the given input stream |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final long SYN
public static final double SYN_D
| Constructor Detail |
|---|
public Util()
| Method Detail |
|---|
public static long getCurrentTime()
public static final long getSYNTime()
public static double getSYNTimeD()
public static double getSYNTimeSeconds()
public static String readLine(InputStream input)
throws IOException
input - - the input string to read from
null if end of input is reached
IOException
public static String readLine(InputStream input,
char terminatorChar)
throws IOException
input - - the input streamterminatorChar - - the character used to terminate lines
null if end of input is reached
IOException
public static void copy(InputStream source,
OutputStream target)
throws Exception
source - - input stream to read fromtarget - - output stream to write to
IOException
Exception
public static void copy(InputStream source,
OutputStream target,
long size,
boolean flush)
throws IOException
source - - input stream to read fromtarget - - output stream to write tosize - - how many bytes to copy (-1 for no limit)flush - - whether to flush after each write
IOException
public static void doHolePunch(UDPEndPoint endpoint,
InetAddress client,
int clientPort)
throws IOException
client - - client address
IOExceptionpublic static String hexString(MessageDigest digest)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||