Welcome to JavaRanch.
Is the question how to convert a text file to a binary file, or how to convert a binary file to a text file?
Any text file
is a binary file, which just happens to contain only text characters, so no conversion is necessary.
A binary file could be
encoded to become a text file, e.g. using the base-64 encoding. A library like
Jakarta Commons Codec can do this.
But somehow I think you're asking something different; what eaxctly are you trying to do?