02-08-2010 07:09 AM
Does somebody experience with this function ( class PersistentContent , function public static byte[] convertEncodingToByteArray(Object encoding) ) , I have some object stored at database and , I get this object from database and used this object as parametr convertEncodingToByteArray function ..
part of code :
private static final class Record implements Persistable
{
....
}
Record recGroup = new Record();
_dataGroup = (Vector)DatabaseGroup.getContents();
recGroup = (Record) _dataGroupelementAt(index);
byte[] pole = PersistentContent.convertEncodingToByteArray(recGr
when I tried this function I got error message "
| Exception thrown: | @5D32A000 | java.lang.IllegalArgumentException |
"
Can you tell me, where is problem .. ( Maybe I bad understend using this function .. )
regards
jiri bruza
02-08-2010 09:10 AM
According to Blackberry APIs
public static byte[] convertEncodingToByteArray(Object encoding)
Converts a PersistentContent encoding of an object into a byte array.
the function will not accept an of Record type
02-09-2010 02:36 AM
allright
I try create mybject based on the object class ..
regards
jiri bruza
02-09-2010 03:50 AM
I tried it again with parametr based on th Object class , but I have got same result .. ( error message - invalid argument )
part of example code :
defination my object :
private static final class MyObj extends Object implements Persistable
{
int number ;
String text = "ahoj" ;
public MyObj()
{
number = 6;
}
}
using this object :
MyObj aaa = new MyObj();
byte[] pole = PersistentContent.convertEncodingToByteArray(aaa);
regards
jiri bruza
02-09-2010 04:12 AM
You can pass an object which has been created by the encode function in the persistent content class.
02-09-2010 12:19 PM
do you think similar to this code ?
public static Object encoding ;
public static byte[] pole;
MyObj aaa = new MyObj();
encoding = PersistentContent.encodeObject(aaa, true, true );
pole = PersistentContent.convertEncodingToByteArray(encod
is correct that encoding is object type ? ( because when I tried part of this code , I have same problem as before )
or do you have some sample for this function please?
regards
Jiri Bruza