Conversion from Stream to SByte

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
Back
Top