|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jrockit.memleak.mlp.MlpUtil
public class MlpUtil
Utility class to avoid polluting other classes with utility methods.
Constructor Summary | |
---|---|
MlpUtil()
|
Method Summary | ||
---|---|---|
static void |
log(java.lang.Exception e)
Minimum effort exception logging. |
|
static java.util.logging.Logger |
logger()
|
|
static java.util.BitSet |
readBitSet(java.io.DataInputStream in,
int byteCount)
Read bit set of byteCount bytes from a
DataInputStream (in ). |
|
static
|
readEnumSet(java.lang.Class<E> enumType,
java.io.DataInputStream in,
int byteCount)
|
|
static
|
toEnumSet(java.lang.Class<E> enumType,
java.util.BitSet bits)
Convert a BitSet into an EnumSet . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MlpUtil()
Method Detail |
---|
public static java.util.BitSet readBitSet(java.io.DataInputStream in, int byteCount) throws java.io.IOException
byteCount
bytes from a
DataInputStream
(in
).
Stream representation:
byte[byteCount] bytes
Where bit i is represented as
bytes[i>>3] & (1 << (i & 7)).
in
- stream to read frombyteCount
- number of bytes to read
java.io.IOException
public static <E extends java.lang.Enum<E>> java.util.EnumSet<E> toEnumSet(java.lang.Class<E> enumType, java.util.BitSet bits)
BitSet
into an EnumSet
. Note that conversion of
EnumSet
s into BitSet
s and vice versa is generally not a
good serialization mechanism for EnumSet
s as it relies on the
enum ordinals and bypasses the binary compatibility serialization of
Enum
and EnumSet
. However, for efficient communication
with non-Java code, it can be useful. It is recommended that the ordinals
of Enum
s used with this method are explicitly specified and
verified at construction time.
E
- enumType
- bits
-
EnumSet
public static <E extends java.lang.Enum<E>> java.util.EnumSet<E> readEnumSet(java.lang.Class<E> enumType, java.io.DataInputStream in, int byteCount) throws java.io.IOException
E
- enumType
- in
- stream to read frombyteCount
- number of bytes to read
EnumSet
java.io.IOException
public static java.util.logging.Logger logger()
public static void log(java.lang.Exception e)
e
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |