Skip to content

Instantly share code, notes, and snippets.

@electrum
Created July 25, 2011 21:55
Show Gist options
  • Select an option

  • Save electrum/1105335 to your computer and use it in GitHub Desktop.

Select an option

Save electrum/1105335 to your computer and use it in GitHub Desktop.
Decode Text in Hadoop WritableComparator
private static String decodeText(byte[] bytes, int start, int len)
throws CharacterCodingException
{
int n = WritableUtils.decodeVIntSize(bytes[start]);
return Text.decode(bytes, start + n, len - n);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment