I know that in J2ME I can get a byte[] object from a String object by using the getBytes() method. My question is : is it possible to get a byte[] object from any other class type ? In addition : is it possible to get a byte[] object from a user-defined class object ?
I know that in J2ME I can get a byte[] object from a String
Share
Some classes may implement a simular service.
Not without you writing the conversion yourself.
Example how to do it yourself (just note that the
DataOutputStreamhandles the conversion, for example which byte order that is used):