473,385 Members | 1,320 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Transfer of byte-array between two hosts

I have a little problem that I am not sure how to solve.

I need to transfer a byte-array between a server and a client using
TCP/IP. The challenge is that it needs to be encapsulated in XML, but
XmlSerialization is not an option, since it is an extension of an
existing design.

The Xml could look like

<data>
<User>
<UserName>stocholm</UserName>
<Age>30</Age>
<PthPreImage>[... byte array goes here ...]</PthPreImage>
</User>
</data>

I need to be able to "restore" the value in Xml to the original byte-
array on the server, since it needs to be applied to SHA1 to verify the
integrity of a "hash-chain" of values.

How the heck do I do this? I am completely blanc with respect to a
solution, so I will be very grateful for a bit of help.

Thanks, :o)

--
Jesper Stocholm
http://stocholm.dk
Give a man a fish and he will have food for a day,
give a man an elephant, and he will have food for a week.
Nov 15 '05 #1
2 1264
Jesper Stocholm <j@stocholm.invalid> wrote:
I need to be able to "restore" the value in Xml to the original byte-
array on the server, since it needs to be applied to SHA1 to verify the
integrity of a "hash-chain" of values.

How the heck do I do this? I am completely blanc with respect to a
solution, so I will be very grateful for a bit of help.


I'd suggest using base 64, as it's reasonably compact and there already
conversion routines in the framework:

Convert.ToBase64String
Convert.FromBase64String

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #2
Jon Skeet [C# MVP] wrote :
Jesper Stocholm <j@stocholm.invalid> wrote:
I need to be able to "restore" the value in Xml to the original byte-
array on the server, since it needs to be applied to SHA1 to verify the
integrity of a "hash-chain" of values.

How the heck do I do this? I am completely blanc with respect to a
solution, so I will be very grateful for a bit of help.


I'd suggest using base 64, as it's reasonably compact and there already
conversion routines in the framework:

Convert.ToBase64String
Convert.FromBase64String


Aaah, yes - of course. Can't believe I missed that.

:o)

--
Jesper Stocholm
http://stocholm.dk
Give a man a fish and he will have food for a day,
give a man an elephant, and he will have food for a week.
Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: lkr | last post by:
hi i got one file transfer program using serialization which has a limitation that i can send only 8192 bytes(8KB). i want to send more than that wht can i do. how can i divide the file into...
3
by: Alessandro | last post by:
Hi all! I'm trying to write a file transfer application using TCP, but I'm having some problem to connect the client and the server. Sniffing with Ethereal I can see the packets sent from the...
0
by: Bob | last post by:
Hi. I'm developed a simple Transfer File program just to test the NetworkStream class. I want to know how can i get the transfer rate speed. Does someone know how to do it? And... what's the size...
9
by: Sakharam Phapale | last post by:
Hi All, I want to read data from one file and write that into another file. Which is a way to do it quickly in terms of processing time? Data to be transfer is huge one. E.g. 2147483458...
6
by: ad | last post by:
I wnat to load a file in an .resx file and transfer the file to a stream. How can I do?
10
by: David | last post by:
I have googled to no avail on getting specifically what I'm looking for. I have found plenty of full blown apps that implement some type of file transfer but what I'm specifcally looking for is an...
5
by: raghubr | last post by:
Hi all, Can any one pls guide me through..I need to transfer the file from server to client and client to server using sockets in an Asynchronous mode so this file transfer doesn't hinder the...
4
by: DanielGifford | last post by:
Hi- I'm trying to transfer files directly to a PDA via a Csharp program I'm writing. Does anyone know how to do this (I obviously can't use active sync). Ohh yes, I'm running Vista. ...
4
by: Andrew Jackson | last post by:
I am writing a newsgroup client. I have the protocol figured out. But I get slow transfer speeds off any of the network objects read the data from For example one of the commands for a news...
1
by: diegoblin | last post by:
Hi, i kind of new to java and i want to transfer a file between a server and a client. I know i have to use InputStream and OutputStream, but i don't know how to do it properly. So far i think i've...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.