public class FrameLeaf extends FrameComponent
| Modifier and Type | Field and Description |
|---|---|
static String |
NOT_UTF8_ERROR
If you call toString() on a FrameLeaf which contains binary data, you get this string as the
result.
|
| Constructor and Description |
|---|
FrameLeaf(boolean bool) |
FrameLeaf(byte[] mydata,
boolean encode)
Create a frameleaf from existing UTF-8 (or true binary) data.
|
FrameLeaf(double myfloat) |
FrameLeaf(double[] mydouble) |
FrameLeaf(float myfloat_) |
FrameLeaf(float[] myfloat) |
FrameLeaf(int myint_) |
FrameLeaf(int[] myint) |
FrameLeaf(long myint) |
FrameLeaf(long[] mylong) |
FrameLeaf(String mydata) |
FrameLeaf(String[] mystring)
This method does NOT support null values in the array.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getData()
Get the raw (usually UTF-8) frame data.
|
boolean |
toBoolean()
Converts the UTF-8 data to a Java boolean.
|
byte[] |
toBytes()
Converts the B64 encoded data to binary and returns it.
|
double |
toDouble()
Converts the UTF-8 data to a Java double type.
|
double[] |
toDoubleArray()
Converts the UTF-8 data to a Java array of double.
|
float |
toFloat()
Converts the UTF-8 data to a Java float type.
|
float[] |
toFloatArray()
Converts the UTF-8 data to a Java array of float.
|
int |
toInt()
Converts the UTF-8 data to a Java int type.
|
int[] |
toIntArray()
Converts the UTF-8 data to a Java array of ints.
|
long |
toLong()
Converts the UTF-8 data to a Java long type.
|
long[] |
toLongArray()
Converts the UTF-8 data to a Java array of longs.
|
String |
toString() |
String[] |
toStringArray() |
getAttributes, setAttributespublic static final String NOT_UTF8_ERROR
public FrameLeaf(byte[] mydata,
boolean encode)
mydata - -encode - -public FrameLeaf(String mydata)
mydata - -public FrameLeaf(String[] mystring)
mystring - -public FrameLeaf(float myfloat_)
public FrameLeaf(float[] myfloat)
myfloat - -public FrameLeaf(double myfloat)
public FrameLeaf(double[] mydouble)
mydouble - -public FrameLeaf(int myint_)
public FrameLeaf(int[] myint)
myint - -public FrameLeaf(long myint)
public FrameLeaf(long[] mylong)
mylong - -public FrameLeaf(boolean bool)
public String[] toStringArray()
public byte[] getData()
public byte[] toBytes()
LeafCastException - if the data was not base64 encoded.public long toLong()
LeafCastException - if the data could not be converted to long.public long[] toLongArray()
LeafCastException - if the data could not be convered to a long array.public int toInt()
LeafCastException - if the data could not be converted to int.public int[] toIntArray()
LeafCastException - if the data could not be convered to an int array.public float toFloat()
LeafCastException - if the data could not be converted to float.public float[] toFloatArray()
LeafCastException - if the data could not be convered to a float array.public double toDouble()
LeafCastException - if the data could not be converted to double.public double[] toDoubleArray()
LeafCastException - if the data could not be convered to a double array.public boolean toBoolean()
LeafCastException - if the underlying data was not utf-8 (which in general should not happen).Copyright © 2018. All rights reserved.