public enum Directive extends java.lang.Enum<Directive>
Directive
defines available directives for
RubyArray.pack(String)
.Enum Constant and Description |
---|
a
String, null padded with a count.
|
A
String, space padded with a count.
|
b
String, bit string (LSB first)
|
B
String, bit string (MSB first)
|
c
8-bit char.
|
d
64-bit double, native endian.
|
D
64-bit double, native endian.
|
e
32-bit float, little-endian.
|
E
64-bit double, little-endian.
|
f
32-bit float, native endian.
|
F
32-bit float, native endian.
|
g
32-bit float, big-endian.
|
G
64-bit double, big-endian.
|
h
String, hex string (low nibble first)
|
H
String, hex string (high nibble first)
|
l
32-bit int, native endian.
|
lb
32-bit int, big-endian.
|
ll
32-bit int, little-endian.
|
q
64-bit long, native endian.
|
qb
64-bit long, big-endian.
|
ql
64-bit long, little-endian.
|
s
16-bit short, native endian.
|
sb
16-bit short, big-endian.
|
sl
16-bit short, little-endian.
|
U
UTF-16 character.
|
Z
String, null padded with a count and null is added with *.
|
Modifier and Type | Field and Description |
---|---|
static java.util.Map<java.lang.String,Directive> |
lookup |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
cast(java.lang.Object o)
Casts an Object to corresponding Byte, Short, Integer or Long if the Object
is a Number, Boolean or Character.
|
boolean |
isWidthAdjustable()
Returns true if the length of packed String is adjustable, false otherwise.
|
java.lang.String |
pack(byte[] bytes)
Packs an array of byte into a binary String.
|
java.lang.String |
pack(java.util.List<java.lang.Byte> bytes)
Packs a List of Byte into a binary String.
|
java.lang.String |
toString() |
java.lang.Object |
unpack(byte[] bytes)
Unpacks an array of byte into an Object.
|
java.lang.Object |
unpack(java.util.List<java.lang.Byte> bytes)
Unpacks a List of Byte into an Object.
|
static Directive |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Directive[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
static boolean |
verify(java.lang.String template)
Verifies a template string.
|
public static final Directive c
public static final Directive s
public static final Directive sb
public static final Directive sl
public static final Directive l
public static final Directive lb
public static final Directive ll
public static final Directive q
public static final Directive qb
public static final Directive ql
public static final Directive D
public static final Directive d
public static final Directive E
public static final Directive G
public static final Directive F
public static final Directive f
public static final Directive e
public static final Directive g
public static final Directive U
public static final Directive A
public static final Directive a
public static final Directive Z
public static final Directive B
public static final Directive b
public static final Directive H
public static final Directive h
public static final java.util.Map<java.lang.String,Directive> lookup
public static Directive[] values()
for (Directive c : Directive.values()) System.out.println(c);
public static Directive valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant
with the specified namejava.lang.NullPointerException
- if the argument is nullpublic boolean isWidthAdjustable()
public java.lang.String pack(java.util.List<java.lang.Byte> bytes)
bytes
- a List of Bytepublic java.lang.String pack(byte[] bytes)
bytes
- an array of bytepublic java.lang.Object unpack(java.util.List<java.lang.Byte> bytes)
bytes
- a List of Bytepublic java.lang.Object unpack(byte[] bytes)
bytes
- an array of bytepublic java.lang.Object cast(java.lang.Object o)
o
- any Objectpublic static boolean verify(java.lang.String template)
template
- a template stringpublic java.lang.String toString()
toString
in class java.lang.Enum<Directive>