@InterfaceAudience.Private public class Writables extends java.lang.Object
| Constructor and Description |
|---|
Writables() |
| Modifier and Type | Method and Description |
|---|---|
static Writable |
copyWritable(byte[] bytes,
Writable tgt)
Copy one Writable to another.
|
static Writable |
copyWritable(Writable src,
Writable tgt)
Copy one Writable to another.
|
static byte[] |
getBytes(Writable... ws)
Put a bunch of Writables as bytes all into the one byte array.
|
static byte[] |
getBytes(Writable w) |
static Writable |
getWritable(byte[] bytes,
int offset,
int length,
Writable w)
Set bytes into the passed Writable by calling its
Writable#readFields(java.io.DataInput). |
static Writable |
getWritable(byte[] bytes,
Writable w)
Set bytes into the passed Writable by calling its
Writable#readFields(java.io.DataInput). |
public static byte[] getBytes(Writable w)
throws java.io.IOException
w - writablew gotten by running its
Writable#write(java.io.DataOutput) method.java.io.IOException - egetWritable(byte[], Writable)public static byte[] getBytes(Writable... ws)
throws java.io.IOException
ws - writablew gotten by running its
Writable#write(java.io.DataOutput) method.java.io.IOException - epublic static Writable getWritable(byte[] bytes,
Writable w)
throws java.io.IOException
Writable#readFields(java.io.DataInput).bytes - serialized bytesw - An empty Writable (usually made by calling the null-arg
constructor).bytes array or IllegalArgumentException
if passed null or an empty bytes array.java.io.IOException - ejava.lang.IllegalArgumentExceptionpublic static Writable getWritable(byte[] bytes,
int offset,
int length,
Writable w)
throws java.io.IOException
Writable#readFields(java.io.DataInput).bytes - serialized bytesoffset - offset into arraylength - length of dataw - An empty Writable (usually made by calling the null-arg
constructor).bytes array or IllegalArgumentException
if passed null or an empty bytes array.java.io.IOException - ejava.lang.IllegalArgumentExceptionpublic static Writable copyWritable(Writable src,
Writable tgt)
throws java.io.IOException
src - Source Writabletgt - Target Writablejava.io.IOException - epublic static Writable copyWritable(byte[] bytes,
Writable tgt)
throws java.io.IOException
bytes - Source Writabletgt - Target Writablejava.io.IOException - e