public class Convert extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
READ_BUFFER_UNIT |
| Constructor and Description |
|---|
Convert() |
| Modifier and Type | Method and Description |
|---|---|
static String |
bytes2String(byte[] bytes)
bytes to string
|
static InputStream |
file2in(String filename,
String prop)
file convert to input stream
|
static org.apache.hadoop.hbase.client.Put |
hdata2put(HData data)
convert hdata to put
|
static Map |
json2Map(net.sf.json.JSONObject json)
json convert to map using ObjectMapper
|
static net.sf.json.JSONObject |
map2Json(Map map)
map convert to json
|
static HData |
result2hdata(org.apache.hadoop.hbase.client.Result result)
convert a result into a hdata
Single row result of a Get or Scan query.
|
static String |
stream2String(InputStream is)
input stream to string
|
static Thread |
stream2StringBuilderAsync(InputStream is,
StringBuilder sb)
start a thread to asynchronously convert the strea to stream builder
|
public static final int READ_BUFFER_UNIT
public static Map json2Map(net.sf.json.JSONObject json)
json - public static net.sf.json.JSONObject map2Json(Map map)
map - public static InputStream file2in(String filename, String prop) throws Exception
filename - prop - Exceptionpublic static org.apache.hadoop.hbase.client.Put hdata2put(HData data)
data - public static HData result2hdata(org.apache.hadoop.hbase.client.Result result) throws Exception
result - Exceptionpublic static String bytes2String(byte[] bytes) throws Exception
bytes - Exceptionpublic static String stream2String(InputStream is)
is - public static Thread stream2StringBuilderAsync(InputStream is, StringBuilder sb)
is - sb - Copyright © 2016. All rights reserved.