A txt extension does not an ASCII file make, so if you want to read that file I suggest you use hexdump (that will be instructive about binary formats, but not immediately useful). By default, hdfs.write will call serialize on its main argument to get a raw vector out of it, unless it is already a raw vector. So what I would try is
hdfs.write(charToRaw("hi"), ofile)
I apologize I can test it myself right now, it's a long story about java versions. To read text files, there is a dedicated hdfs.read.text.file. I hope this helps