心理

當前位置 /首頁/完美生活/心理/列表

map如何轉成byte數組

map如何轉成byte數組

把Map轉換成byte數組,使用 ByteArrayOutputStream 和 ObjectOutputStream

ByteArrayOutputStream stream = new ByteArrayOutputStream()

bmp.compress(Bitmap.CompressFormat.PNG, 100, stream)

byte[] byteArray = teArray()

public static byte[] getSerializedBytes(Map<String, Double> list) {undefined

if (null == list || () < 0)

return null

try {undefined

ByteArrayOutputStream bo = new ByteArrayOutputStream()

ObjectOutputStream os = new ObjectOutputStream(bo)

eObject(list)

return teArray()

} catch (IOException e) {undefined

return null

TAG標籤:byte map 轉成 數組 #