package org.javaniu.encryptanddecrypt; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; /** * 对象与字节数组互相转�? * @author javaniu_飞翔 */ public class Convertor { public static void main(String[] args) { } /** * 把字节数组转换成对象 * @param data * @return */ public static Object deserialize( byte[] data ) { Object obj = null; ByteArrayInputStream in = new ByteArrayInputStream(data); ObjectInputStream is; try { is = new ObjectInputStream(in); obj = is.readObject(); } catch (Exception e) { e.printStackTrace(); } return obj; } /** * 把对象转换成字节数组 * @param obj * @return */ public static byte[] toByteArray( Object obj ) { byte[] b = null; try { ByteArrayOutputStream out = new ByteArrayOutputStream(); ObjectOutputStream os = new ObjectOutputStream(out); os.writeObject( obj ); b = out.toByteArray(); } catch (IOException e) { e.printStackTrace(); } return b; } }

asdf123411 LV2
2021年5月21日
wananall LV13
2020年6月28日
jhxly123 LV6
2019年8月18日
Cesare LV3
2019年6月26日
2224947710 LV17
2018年8月18日
故事_sun LV26
2018年5月25日
shuilianbing LV6
2018年5月19日
shao9803 LV12
2018年5月19日
mahuig LV10
2018年3月17日
1324488732 LV27
2018年3月5日

heqian LV17
2022年12月5日
SZEPEZS LV9
2022年6月9日
17842711 LV1
2022年3月28日
无语问苍天 LV1
2021年7月30日
asdf123411 LV2
2021年5月21日
smiledog LV2
2021年1月29日
1113783182 LV1
2020年7月9日
zzs269285304 LV7
2020年6月29日
wananall LV13
2020年6月28日
ma406805131 LV19
2020年6月18日