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 2 3715
Nick <Ni**@discussio ns.microsoft.co m> 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.co m> http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
I was able to get it done alright...
Cheers!
"Jon Skeet [C# MVP]" wrote: Nick <Ni**@discussio ns.microsoft.co m> 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.co m> http://www.pobox.com/~skeet If replying to the group, please do not mail me too This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Stephen Gennard |
last post by:
Hello,
I having a problem dynamically invoking a static method that takes a
reference to a SByte*. If I do it directly it works just fine.
Anyone any ideas why?
I have include a example below...
--
|
by: Steve - DND |
last post by:
After downloading and using two different memory profiling applications
today, it seems that sbyte, int16, and int32 are all stored using 12b of
memory. Someone please tell me I'm reading these memory profilers wrong! If
I'm really reading it correctly, then what's the point of using anything
other than a 32 bit integer? If they're all going to be stored the same way,
then I can't achieve any memory savings(which I was really hoping for) by...
|
by: Enosh Chang |
last post by:
Hi,
I encounter one problem about System.IO. I have a binary file that contains
following structure,
struct MyFormat
{
public sbyte Type;
public sbyte Num;
public sbyte Flag;
|
by: acerblue |
last post by:
Hi,
I've an array of sbyte with null char termination. I'd like to convert it to
string type. How can I do that ?
Thanks
ssggys
|
by: Pat Ireland |
last post by:
I am attempting to pass an SByte to another .NET class that expects the
data to be passed as SByte *. I searched around and found the boxing can be
used to produce a pointer but I'm not sure if this is appropriate. I am using
the following sequence:
// Load class
Assembly c = Assembl.LoadFrom("filename ....);
// Get the types
cTypes = c.GetTypes();
| |
by: Nick |
last post by:
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,...
|
by: Pavils Jurjans |
last post by:
Hello,
I am somewhat lost in the implicit/expicit possible/impossible type casting
in C#...
I need to write a class, which among other things, must have wat to read a
numeric value type, and internally convert it so that it could be saved in
database as real number (float). I plan to provide property(set) interface
for reading the value.
|
by: pkoniusz |
last post by:
Hello everybody,
Been just thinking how actually one could convert the following
unmanaged code to the managed C++:
struct JustAnExample
{
char value1;
int value2;
// etc ....
|
by: =?Utf-8?B?Q2hyaXMgRmluaw==?= |
last post by:
I am trying to make a minor modification to the code below and need some
assistance. Currently this code is using the java.util, java.util.zip, and
java.io assemblies from the vjslib.dll assembly. This code works fine by
taking file(s) from
disk and creating a zip file to disk. I need to modify this code to read a
file from a byte array and then output the zip file to a byte array (all done
in memory instead of disk). The reason for...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |