public class Util extends Object
Some common constants and methods.
Modifier and Type | Field and Description |
---|---|
static int |
BOOLEAN_LENGTH
Size of a boolean in bytes.
|
static int |
DOUBLE_LENGTH
Size of an double in bytes.
|
static int |
FLOAT_LENGTH
Size of an float in bytes.
|
static int |
INT_LENGTH
Size of an int in bytes.
|
static int |
LONG_LENGTH
Size of a long in bytes.
|
Constructor and Description |
---|
Util() |
Modifier and Type | Method and Description |
---|---|
static int |
stringLength(int length)
Returns the number of bytes needed to write a string.
|
static int |
stringLength(String s)
Returns the number of bytes needed to write a string.
|
public static final int BOOLEAN_LENGTH
public static final int INT_LENGTH
public static final int LONG_LENGTH
public static final int FLOAT_LENGTH
public static final int DOUBLE_LENGTH
public static final int stringLength(int length)
length
- The number of characters in the string.public static final int stringLength(String s)
s
- The string.Copyright © 2013. All Rights Reserved.