List of usage examples for org.apache.hadoop.io ArrayWritable write
@Override public void write(DataOutput out) throws IOException
From source file:com.mozilla.hadoop.hbase.mapreduce.MultiScanTableMapReduceUtil.java
License:Apache License
/** * Converts an array of Scan objects into a base64 string * @param scans//from w ww . j av a2 s . c om * @return * @throws IOException */ public static String convertScanArrayToString(final Scan[] scans) throws IOException { final ByteArrayOutputStream baos = new ByteArrayOutputStream(); final DataOutputStream dos = new DataOutputStream(baos); ArrayWritable aw = new ArrayWritable(Scan.class, scans); aw.write(dos); return Base64.encodeBytes(baos.toByteArray()); }