|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.hbase.util.Writables
public class Writables
Utility class with methods for manipulating Writable objects
| Constructor Summary | |
|---|---|
Writables()
|
|
| Method Summary | |
|---|---|
static long |
bytesToLong(byte[] bytes)
Converts a byte array to a long value |
static String |
bytesToString(byte[] bytes)
Converts a byte array to a string in a consistent manner. |
static Writable |
copyWritable(Writable src,
Writable tgt)
Copy one Writable to another. |
static byte[] |
getBytes(Writable w)
|
static HRegionInfo |
getHRegionInfo(byte[] bytes)
|
static HRegionInfo |
getHRegionInfoOrNull(byte[] bytes)
|
static Writable |
getWritable(byte[] bytes,
Writable w)
Set bytes into the passed Writable by calling its Writable.readFields(java.io.DataInput). |
static byte[] |
longToBytes(long val)
Convert a long value to a byte array |
static byte[] |
stringToBytes(String s)
Converts a string to a byte array in a consistent manner. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Writables()
| Method Detail |
|---|
public static byte[] getBytes(Writable w)
throws IOException
w -
w gotten by running its
Writable.write(java.io.DataOutput) method.
IOExceptiongetWritable(byte[], Writable)
public static Writable getWritable(byte[] bytes,
Writable w)
throws IOException
Writable.readFields(java.io.DataInput).
bytes - w - An empty Writable (usually made by calling the null-arg
constructor).
bytes array or IllegalArgumentException
if passed null or an empty bytes array.
IOException
IllegalArgumentException
public static HRegionInfo getHRegionInfo(byte[] bytes)
throws IOException
bytes -
bytes.
IOException
public static HRegionInfo getHRegionInfoOrNull(byte[] bytes)
throws IOException
bytes -
bytes
or null if passed bytes are null or an empty array.
IOException
public static Writable copyWritable(Writable src,
Writable tgt)
throws IOException
src - Source Writabletgt - Target Writable
IOException
public static byte[] longToBytes(long val)
throws IOException
val -
IOException
public static long bytesToLong(byte[] bytes)
throws IOException
bytes -
IOException
public static byte[] stringToBytes(String s)
throws UnsupportedEncodingException
s -
UnsupportedEncodingException
public static String bytesToString(byte[] bytes)
throws UnsupportedEncodingException
bytes -
UnsupportedEncodingException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||