You say the values are stored as BytesWritable
. That maps to byte[]
in Java, a byte array -- and that is exactly what's being printed, since the toString()
method is overloaded to do that.
You also mention that the bytes might be text in Chinese. If you want to output that, you'll need to encode the bytes to String
. You should change the line
bw.write("Value::: " + value);
to a couple of others.
byte[] strBytes = ((BytesWritable) value).getBytes();
bw.write("Value::: " + new String(strBytes, Charset.forName("UTF-8")));
This assumes the Chinese string is encoded using "UTF-8", which might now be the case. You'll have to try different encodings and see what works if you don't know the exact one.