Reading Strings and Binary from the same FileInputStream

前端 未结 7 1975
离开以前
离开以前 2021-01-17 22:29

I have a file that contains some amount of plain text at the start followed by binary content at the end. The size of the binary content is determined by some one of the pla

相关标签:
7条回答
  • 2021-01-17 23:04

    You can read the text with BufferedReader. When you know where the binary starts you can close the file and open it with RandomAccessFile and read binary from any point in the file. Or you can read the file as binary and convert to text the sections you identify as text. {Using new String(bytes, encoding)}

    0 讨论(0)
提交回复
热议问题