public final class Utilities extends Object
Modifier and Type | Field and Description |
---|---|
static int |
MAX_PAYLOAD_LENGTH |
static String |
PRODUCTION_FEEDBACK_HOST |
static int |
PRODUCTION_FEEDBACK_PORT |
static String |
PRODUCTION_GATEWAY_HOST |
static int |
PRODUCTION_GATEWAY_PORT |
static String |
SANDBOX_FEEDBACK_HOST |
static int |
SANDBOX_FEEDBACK_PORT |
static String |
SANDBOX_GATEWAY_HOST |
static int |
SANDBOX_GATEWAY_PORT |
Modifier and Type | Method and Description |
---|---|
static void |
close(Closeable closeable) |
static void |
close(Socket closeable) |
static byte[] |
copyOf(byte[] bytes) |
static byte[] |
copyOfRange(byte[] original,
int from,
int to) |
static byte[] |
decodeHex(String deviceToken) |
static String |
encodeHex(byte[] bytes) |
static byte[] |
marshall(byte command,
byte[] deviceToken,
byte[] payload) |
static byte[] |
marshallEnhanced(byte command,
int identifier,
int expiryTime,
byte[] deviceToken,
byte[] payload) |
static int |
parseBytes(int b1,
int b2,
int b3,
int b4) |
static Map<String,Date> |
parseFeedbackStream(InputStream in) |
static Map<byte[],Integer> |
parseFeedbackStreamRaw(InputStream in) |
static void |
sleep(int delay) |
static byte[] |
toUTF8Bytes(String s) |
static String |
truncateWhenUTF8(String s,
int maxBytes) |
static void |
wrapAndThrowAsRuntimeException(Exception e) |
public static final String SANDBOX_GATEWAY_HOST
public static final int SANDBOX_GATEWAY_PORT
public static final String SANDBOX_FEEDBACK_HOST
public static final int SANDBOX_FEEDBACK_PORT
public static final String PRODUCTION_GATEWAY_HOST
public static final int PRODUCTION_GATEWAY_PORT
public static final String PRODUCTION_FEEDBACK_HOST
public static final int PRODUCTION_FEEDBACK_PORT
public static final int MAX_PAYLOAD_LENGTH
public static byte[] decodeHex(String deviceToken)
public static String encodeHex(byte[] bytes)
public static byte[] toUTF8Bytes(String s)
public static byte[] marshall(byte command, byte[] deviceToken, byte[] payload)
public static byte[] marshallEnhanced(byte command, int identifier, int expiryTime, byte[] deviceToken, byte[] payload)
public static Map<byte[],Integer> parseFeedbackStreamRaw(InputStream in)
public static Map<String,Date> parseFeedbackStream(InputStream in)
public static void close(Closeable closeable)
public static void close(Socket closeable)
public static void sleep(int delay)
public static byte[] copyOf(byte[] bytes)
public static byte[] copyOfRange(byte[] original, int from, int to)
public static void wrapAndThrowAsRuntimeException(Exception e) throws NetworkIOException
NetworkIOException
public static int parseBytes(int b1, int b2, int b3, int b4)
Copyright © 2015. All rights reserved.