how can I return a byte array from a function in Java

L

lrantisi

Dera friends.
how can I return a byte array from a function in Java.
Give me an example about a function that returns a byte array.
Thank you...
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

lrantisi said:
how can I return a byte array from a function in Java.
Give me an example about a function that returns a byte array.

public byte[] returnByteArray()
{
byte[] res = new byte[2];
res[0] = 1;
res[1] = 2;
return res;
}

Arne
 
K

Knute Johnson

lrantisi said:
Dera friends.
how can I return a byte array from a function in Java.
Give me an example about a function that returns a byte array.
Thank you...

byte[] returnsByteArray() {
byte[] byteArray = new byte[1000];
return byteArray;
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,270
Messages
2,571,102
Members
48,773
Latest member
Kaybee

Latest Threads

Top