0

I have stored an Erlang Term into a bucket/key in Riak.

This Term is stored as what I believe is binary by Erlang.

For example this is the original erlang Term: {someAtom,[1,2,3],{"text1","text2"}}

Using a java program I am trying to obtain the data using a riak client, but the data is encoded. Riak stores data as binary as well, but the java client has a getValueAsString() method, but that does not work (obviously) since the source data was binary.

The point is, if I read this data as byte[] in java, how do I decode it to a string that reppresents this text : {someAtom,[1,2,3],{"text1","text2"}} ? To be more specific, is erlang storing as bytes that reppresent individual character's ASCII code ?

gextra
  • 8,439
  • 8
  • 40
  • 62

1 Answers1

0

I'm almost sure you use wrong interface to access data from Java. Take a look at Riak Java client quick start. They don't use getValueAsString() and there is a code where they use RiakResponse.getRiakObjects(). Try it.

Dmitry Belyaev
  • 2,573
  • 12
  • 17