public class SocksUtil extends Object
SocksUtil
is a tool class.Constructor and Description |
---|
SocksUtil() |
Modifier and Type | Method and Description |
---|---|
static int |
bytesToInt(byte[] bytes)
Get an integer from a byte array.
|
static int |
bytesToInt(byte b1,
byte b2)
Returns a port.
|
static byte |
getFisrtByteFromInt(int num)
Returns the first byte of an integer.
|
static byte |
getSecondByteFromInt(int num)
Returns the second byte of an integer.
|
static byte[] |
intTo2bytes(int num)
Get bytes from an Integer.
|
public static byte[] intTo2bytes(int num)
num
- an integer.public static byte getFisrtByteFromInt(int num)
num
- an integer.public static byte getSecondByteFromInt(int num)
num
- Port.public static int bytesToInt(byte[] bytes)
bytes
- A byte array.public static int bytesToInt(byte b1, byte b2)
b1
- First byte.b2
- Second byte.Copyright © 2015. All rights reserved.