ObjectInputStream happy with FileInputStream, not happy with getResourceAsStream

后端 未结 5 1757
闹比i
闹比i 2020-12-10 12:42

I have some pretty standard code which takes in a serialized object from a stream, which bascially looks like this:

  Object getObjectFromStream(InputStream is) {         


        
5条回答
  •  渐次进展
    2020-12-10 13:21

    EFBFBD is a UTF-8 representation of Unicode replacement character U+FFFD. So, it looks like file was passed through some encoding conversion process.

    Maven can be a suspect, especially its resource filtering feature.

提交回复
热议问题