HashMap with byte array key and String value - containsKey() function doesn't work

前端 未结 4 788
自闭症患者
自闭症患者 2021-01-18 00:53

I\'m using a HashMap: byte[] key and String value. But I realize that even I put the same object (same byte array and same string value) by using

myList.put(         


        
4条回答
  •  天命终不由人
    2021-01-18 01:24

    You can use ByteBuffer, which is a wrapper for byte[] array with a comparator.

    Referring answer from - https://stackoverflow.com/a/14087243/4019660

提交回复
热议问题