List of usage examples for org.apache.hadoop.fs MD5MD5CRC32FileChecksum getBytes
@Override public byte[] getBytes()
From source file:com.bigstep.datalake.JsonUtil.java
License:Apache License
/** Convert a MD5MD5CRC32FileChecksum to a Json string. */ public static String toJsonString(final MD5MD5CRC32FileChecksum checksum) { if (checksum == null) { return null; }//from w w w. j a v a 2s . c o m final Map<String, Object> m = new TreeMap<String, Object>(); m.put("algorithm", checksum.getAlgorithmName()); m.put("length", checksum.getLength()); m.put("bytes", StringUtils.byteToHexString(checksum.getBytes())); return toJsonString(FileChecksum.class, m); }