java - How can I get the byte value in a Map -


this question has answer here:

i value of byte inside map object.

map<string, object> data = new hashmap<>(); data.put("foo", new byte[]{4});  system.out.println(data.get("foo")); 

what i'm getting this... [b@1a779dce

please me.

as adding object map not byte[] need cast it.

map<string, object> data = new hashmap<>(); data.put("foo", new byte[]{4,3,1,2}); system.out.println(arrays.tostring((byte[])data.get("foo"))); 

output

[4,3,1,2] 

Comments

Popular posts from this blog

C# random value from dictionary and tuple -

cgi - How do I interpret URLs without extension as files rather than missing directories in nginx? -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -