HighTechTalks DotNet Forums  

sending byte array from vb.net to j#

Dotnet VJSharp microsoft.public.dotnet.vjsharp


Discuss sending byte array from vb.net to j# in the Dotnet VJSharp forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Asaf Seri
 
Posts: n/a

Default sending byte array from vb.net to j# - 09-02-2004 , 12:17 PM






Hello



I have j# project that is transferring files with Ftp.

The upload method is receiving the uploaded file as byte array.

I知 trying to use the upload method from another project, vb.net project,
but I can not send byte array because the byte in j# in sign and in vb.net
is unsigned meaning different types.

In c# I知 using sbyte array, and it is working well. In vb.net there is no
sbyte.

Does someone have any idea how can I read file in vb.net and convert it to
signed byte array (compatible to java byte)?



Thanks

Asaf



Reply With Quote
  #2  
Old   
AT
 
Posts: n/a

Default RE: sending byte array from vb.net to j# - 09-07-2004 , 07:57 AM






Hello Asaf,

Since J# byte array cannot be used directly where ubyte array is expected,
you will need to convert the byte array to appropriate type before calling
the function.

You can use the following:

byte[] byteArr = new byte[100]{1, 2, 3...};
ubyte[] dest = new ubyte[byteArr.length];

System.Buffer.BlockCopy(byteArr, 0, dest, 0, byteArr.length);


Hope this helps.

Thanks,
Gopi Krishnam [MSFT]
--------------------
Quote:
Reply-To: "Asaf Seri" <aseri (AT) 012 (DOT) net.il
From: "Asaf Seri" <aseri (AT) 012 (DOT) net.il
Subject: sending byte array from vb.net to j#
Date: Thu, 2 Sep 2004 18:17:08 +0200
Lines: 25
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
Message-ID: <eJjHmAQkEHA.3392 (AT) TK2MSFTNGP15 (DOT) phx.gbl
Newsgroups: microsoft.public.dotnet.vjsharp
NNTP-Posting-Host: sabratec-f.bb.netvision.net.il 212.143.56.182
Path:
cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFT NGP08.phx.gbl!TK2MSFTNGP15
.phx.gbl
Quote:
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.vjsharp:6436
X-Tomcat-NG: microsoft.public.dotnet.vjsharp

Hello



I have j# project that is transferring files with Ftp.

The upload method is receiving the uploaded file as byte array.

I知 trying to use the upload method from another project, vb.net project,
but I can not send byte array because the byte in j# in sign and in vb.net
is unsigned meaning different types.

In c# I知 using sbyte array, and it is working well. In vb.net there is no
sbyte.

Does someone have any idea how can I read file in vb.net and convert it to
signed byte array (compatible to java byte)?



Thanks

Asaf





Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.