Decoding blob data from a sqlite database into a human readable text

后端 未结 1 1986
长发绾君心
长发绾君心 2021-01-25 20:30

I have a Sqlite database file that has blob data in it. I only know the the database has blob data and I know what the expected output should be. The blob data\'s expected outp

相关标签:
1条回答
  • 2021-01-25 20:32

    Right now you are printing a byte[] array toString(). Arrays in Java don't implement in meaningful way.

    You can try converting the byte[] array into a String with:

    new String(buffer, Charsets.UTF_8)
    

    If this doesn't work use rs.getBinaryStream(1) to get the InputStream representing the value and read it as per this answer.

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