public class PayloadHelper extends Object
Constructor and Description |
---|
PayloadHelper() |
Modifier and Type | Method and Description |
---|---|
static float |
decodeFloat(byte[] bytes) |
static float |
decodeFloat(byte[] bytes,
int offset)
Decode the payload that was encoded using
encodeFloat(float) . |
static int |
decodeInt(byte[] bytes,
int offset) |
static byte[] |
encodeFloat(float payload) |
static byte[] |
encodeFloat(float payload,
byte[] data,
int offset) |
static byte[] |
encodeInt(int payload) |
static byte[] |
encodeInt(int payload,
byte[] data,
int offset) |
public static byte[] encodeFloat(float payload)
public static byte[] encodeFloat(float payload, byte[] data, int offset)
public static byte[] encodeInt(int payload)
public static byte[] encodeInt(int payload, byte[] data, int offset)
public static float decodeFloat(byte[] bytes)
decodeFloat(byte[], int)
,
encodeFloat(float)
public static final float decodeFloat(byte[] bytes, int offset)
encodeFloat(float)
.
NOTE: the length of the array must be at least offset + 4 long.bytes
- The bytes to decodeoffset
- The offset into the array.encodeFloat(float)
public static final int decodeInt(byte[] bytes, int offset)
Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.