I have a hadoop job for which its final output is the following
String myKey = "myKey";
context.write(myKey, myObjectWritable.toByteArray());
My output file look like the following
myKey/t00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
my question is how do I convert the bytes in string to a byte[]
since the file is consist of string and bytes that is written as string.
try (BufferedReader br = new BufferedReader(new FileReader("my_map_reduce_file"))) {
String line;
while ((line = br.readLine()) != null) {
String[] x = line.split("\t");
// how do I convert x[1] to byte[]
}