Conversion from Stream to SByte

G

Guest

Hi,

Problem statement: Calling a java method from Dot Net code that returns a
java byte array.

Overview: I have a java server from which I need to establish connection. I
hva ebeen able to send across data to the server in a serialised stream.
However, when I need to geta response back to the client (.Net), I get a
binary stream. What I wanna do is to convert this stream into an SByte array
(The java byte is actually a signed byte, the System.SByte object). This
SByte array then gets passed into the java method which would give me an
object.

Hurdles: I am unable to convert the Stream into a byte array. (To convert
this byte array into an SByte array, I have created a function). Ideally, if
I could convert this stream into an SByte itself, instead of having to use
this function, it would be great. Have been googling for quite some time, but
have been unsuccessful so far. Could someone please help me out on this???

Anticipating,
Nick
 
J

Jon Skeet [C# MVP]

Nick said:
Problem statement: Calling a java method from Dot Net code that returns a
java byte array.

Overview: I have a java server from which I need to establish connection. I
hva ebeen able to send across data to the server in a serialised stream.
However, when I need to geta response back to the client (.Net), I get a
binary stream. What I wanna do is to convert this stream into an SByte array
(The java byte is actually a signed byte, the System.SByte object). This
SByte array then gets passed into the java method which would give me an
object.

Hurdles: I am unable to convert the Stream into a byte array. (To convert
this byte array into an SByte array, I have created a function). Ideally, if
I could convert this stream into an SByte itself, instead of having to use
this function, it would be great. Have been googling for quite some time, but
have been unsuccessful so far. Could someone please help me out on this???

See http://www.pobox.com/~skeet/csharp/readbinary.html
 

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

Top