How to read erlang term from redis by using java client?

孤者浪人 提交于 2019-12-06 16:38:33
Daniel

The negative numbers at the beginning of the byte array are not valid values for erlang external term syntax.

I would assume that since you have been storing the erlang terms in redis this way for some time, you are inserting them correctly.

That really only leaves one thing: When you call getBytes() your encoding is off, it is most likely using whatever encoding is set as the default on your system (probably UTF-8, but I'm not sure). Really what you want to do is pass a different encoding to getBytes(), probably like this: getBytes("US-ASCII").

check out the documentation for encodings are available.

Heres a link on SO that shows how to convert a string to an ASCII byte array.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!