The problem is how to except an byte[]
from serialization of XMLEncoder, but i need to save this field to DB. I have a Object
public class MyClass1 implements Serializable {
some properties ...
private byte[] a01_14_01_content;
getters and setters ...
}
and Encoder:
import java.beans.XMLEncoder;
public class MyEncoder{
...
public byte[] getBytes() {
XMLEncoder e = new XMLEncoder(baos);
e.writeObject(answer);
e.close();
return baos.toByteArray();
}
}
I need to serialize all fields except array fields.
transient
modifier for property doesn't work;
@Transient
annotation on on get method doesn't work;
@XMLTransient
annotation on property doesn't work.
It's so simple, but I need help of community!