R
RC
For example
int i = 2;
char c = 'c';
float f = (float)3.45;
double d = 3.546;
String s = "Hello";
I want to write all these into a binary file.
In OutputStream, PrintStream classes
they have
write(int byte); and
write(byte[] buffer, int offset, int length);
My question is how do I convert those i,c,f,d,s into
byte[]?
Thank Q in advance!
int i = 2;
char c = 'c';
float f = (float)3.45;
double d = 3.546;
String s = "Hello";
I want to write all these into a binary file.
In OutputStream, PrintStream classes
they have
write(int byte); and
write(byte[] buffer, int offset, int length);
My question is how do I convert those i,c,f,d,s into
byte[]?
Thank Q in advance!