|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.oozie.util.WritableUtils
public class WritableUtils
Utility class to write/read Hadoop writables to/from a byte array.
Constructor Summary | |
---|---|
WritableUtils()
|
Method Summary | ||
---|---|---|
static
|
fromByteArray(byte[] array,
Class<T> clazz)
Read a writable from a byte array. |
|
static String |
readStr(DataInput dataInput)
Read a string from a data input supporting null values. |
|
static byte[] |
toByteArray(org.apache.hadoop.io.Writable writable)
Write a writable to a byte array. |
|
static void |
writeStr(DataOutput dataOutput,
String str)
Write a string to a data output supporting null values. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WritableUtils()
Method Detail |
---|
public static byte[] toByteArray(org.apache.hadoop.io.Writable writable)
writable
- writable to write.
public static <T extends org.apache.hadoop.io.Writable> T fromByteArray(byte[] array, Class<T> clazz)
array
- byte array with the serialized writable.clazz
- writable class.
public static void writeStr(DataOutput dataOutput, String str) throws IOException
null
values. It uses the '||' token to represent
null
.
dataOutput
- data output.str
- string to write.
IOException
- thrown if the string could not be written.public static String readStr(DataInput dataInput) throws IOException
null
values. It uses the '||' token to represent
null
.
dataInput
- data input.
null
if the '||' token was read.
IOException
- thrown if the string could not be read.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |