471,357 Members | 1,272 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,357 software developers and data experts.

Conversion from Stream to SByte

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
Jul 22 '05 #1
2 3511
Nick <Ni**@discussions.microsoft.com> wrote:
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

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 22 '05 #2
I was able to get it done alright...
Cheers!

"Jon Skeet [C# MVP]" wrote:
Nick <Ni**@discussions.microsoft.com> wrote:
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

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Jul 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Stephen Gennard | last post: by
3 posts views Thread by Steve - DND | last post: by
reply views Thread by Enosh Chang | last post: by
2 posts views Thread by acerblue | last post: by
5 posts views Thread by Pat Ireland | last post: by
2 posts views Thread by Nick | last post: by
5 posts views Thread by Pavils Jurjans | last post: by
8 posts views Thread by =?Utf-8?B?Q2hyaXMgRmluaw==?= | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.