|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jclass.util
Stupid class that contains various simple but useful methods.
Written: Radu Sion
Version: 0.24
Source: util.java
Visit
Smart Software
Constructor Summary | |
util()
|
Method Summary | |
static int |
bytes2int(byte[] data)
Creates a integer out of four bytes using the big endian technique |
static byte[] |
bytescat(byte[] b1,
byte[] b2)
Appends b2 to b1 and returns the result. |
static byte[] |
bytescut(int i1,
int i2,
byte[] b)
Cuts between i1 and i2 in b (inclusive) and returns the result. |
static void |
closeInputStream(java.io.InputStream ss)
|
static void |
closeOutputStream(java.io.OutputStream ss)
|
static void |
closeSocket(java.net.Socket ss)
|
static int |
getDigit(int position,
long value)
Returns the named digit from a long starting with digit 0 at the rightmost position. |
static byte[] |
int2bytes(int data)
Returns a four bytes array representation of a integer using big endian technique. |
static int |
pow_int(int a,
int b)
|
static long |
pow_long(long a,
long b)
|
static java.lang.String |
readLine(java.io.InputStream is)
nbsp; The method bellow is adapted from the jdk102 DataInputStream source and reads from a InputStream a whole line, that has been terminated by a \n, \r, \r\n or EOF. |
static int |
stringWidth(java.lang.String str,
java.awt.FontMetrics fm)
Returns the pixel width of the specified string using the specified fontmetric. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public util()
Method Detail |
public static int pow_int(int a, int b)
public static long pow_long(long a, long b)
public static void closeInputStream(java.io.InputStream ss)
public static void closeOutputStream(java.io.OutputStream ss)
public static void closeSocket(java.net.Socket ss)
public static byte[] bytescat(byte[] b1, byte[] b2)
public static byte[] bytescut(int i1, int i2, byte[] b)
public static int bytes2int(byte[] data)
public static byte[] int2bytes(int data)
public static int getDigit(int position, long value)
public static int stringWidth(java.lang.String str, java.awt.FontMetrics fm)
public static java.lang.String readLine(java.io.InputStream is) throws java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |