|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.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,
java.lang.Class<T> clazz)
Read a writable from a byte array. |
|
static java.lang.String |
readStr(java.io.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(java.io.DataOutput dataOutput,
java.lang.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,
java.lang.Class<T> clazz)
array - byte array with the serialized writable.clazz - writable class.
public static void writeStr(java.io.DataOutput dataOutput,
java.lang.String str)
throws java.io.IOException
null values. It uses the '||' token to represent
null.
dataOutput - data output.str - string to write.
java.io.IOException - thrown if the string could not be written.
public static java.lang.String readStr(java.io.DataInput dataInput)
throws java.io.IOException
null values. It uses the '||' token to represent
null.
dataInput - data input.
null if the '||' token was read.
java.io.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 | |||||||||