07-18-2007, 07:18 AM
|
#1 (permalink)
|
| Thumbs Must Hurt
Join Date: Jul 2007 Model: 8800 PIN: N/A Carrier: TDC
Posts: 115
Post Thanks: 0 Thanked 0 Times in 0 Posts
| java.io classes missing in RIM API Please Login to Remove! hi guyz... im desperately in need of the ObjectInputStream class as i need to convert a byte[] to an object which then will be casted to a hashMap.
I had no problem converting my hashmap to a byte[] with java where i used this method on my serverside application using the Java API
private static byte[] serialize(Object o) throws IOException {
ByteArrayOutputStream ba = new ByteArrayOutputStream();
ObjectOutputStream oba = new ObjectOutputStream(ba);
oba.writeObject(o);
return ba.toByteArray();
}
however... when using RIM API they removed the ObjectInputStream classes which makes this method not being able to compile
private static Object deserialize(byte[] b) throws IOException, ClassNotFoundException {
ByteArrayInputStream ba = new ByteArrayInputStream(b);
ObjectInputStream oba = new ObjectInputStream(ba);
return oba.readObject();
}
any way around this? |
| Offline
| |