/** * Uncompress the input as a String * * @param input * @return the uncompressed dasta * @throws IOException */ public static String uncompressString(byte[] input) throws IOException { try { return uncompressString(input, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new IllegalStateException("UTF-8 decoder is not found"); } }
/** * Uncompress the input[offset, offset+length) as a String * * @param input * @param offset * @param length * @return the uncompressed data * @throws IOException */ public static String uncompressString(byte[] input, int offset, int length) throws IOException { try { return uncompressString(input, offset, length, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new IllegalStateException("UTF-8 decoder is not found"); } }
public String uncompressString(byte[] target) { try { return Snappy.uncompressString(target); } catch (IOException e) { logger.error(e); throw new RuntimeException(e); } }
public String uncompressString(byte[] target, Charset charset) { try { return Snappy.uncompressString(target, charset); } catch (IOException e) { logger.error(e); throw new RuntimeException(e); } }