Here you can find the source of deserializeProperties(byte[] bytes)
Parameter | Description |
---|---|
bytes | bytes array that is supposed to contain serialized properties data |
public static Properties deserializeProperties(byte[] bytes)
//package com.java2s; //License from project: Open Source License import java.io.ByteArrayInputStream; import java.io.IOException; import java.util.Properties; public class Main { /**//www . j av a2 s.c om * Tries to deserialize given bytes array to Properties instance * * @param bytes bytes array that is supposed to contain serialized properties data * @return Properties instance populated with data deserialized from given bytes array, * or empty if deserialization failed */ public static Properties deserializeProperties(byte[] bytes) { Properties properties = new Properties(); if (bytes != null) { try { ByteArrayInputStream bais = new ByteArrayInputStream(bytes); properties.load(bais); bais.close(); } catch (IOException e) { } } return properties; } }