Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 19th, 2006, 11:45 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default Buffer question

Ok this is a similar question to my previous thread that got 0 responses but maybe this will help everyone out. Here is what I have done:

        Dim httpFile As HttpPostedFile = File1.PostedFile
        Dim buffer As System.IO.BufferedStream
        Dim byt(buffer.Length) As Byte

        buffer = New System.IO.BufferedStream(httpFile.InputStream)
        buffer.Read(byt, 0, buffer.Length)
        buffer.Flush()
        buffer.Close()


Now here is my thing, i convert byt to a string

        Dim strImage as string =System.text.encoding.Default.GetChars(byt)

I am doing this because I am trying to parse an image out of a Raw HTTP Request, I have been able to do this and I saved the image data to a text file to make sure i was doing this correctly, but my image data keeps getting corrupt. I have narrowed it down to about a series of 10 bytes.

The data that I collect in the above code is the good data, i can turn around and send that byte array back to the browser and it will display the image so i wrote out my byte values for the above code and then my byte values for the code that i have saved in a text file and the error occurs where I have, essentially, a Non Breaking space. The above code tells me it is a byte value of 0 but when i convert the text file of characters to an array of bytes it is telling me that a non breaking space has a value of 32?

So I guess my question is 1 wtf is a byte value of 32 and is there anyway to search a byte array and replace certain values in my case 32 with 0?



"The one language all programmers understand is profanity."
__________________
===============================================
Doug Parsons
Wrox online library: Wrox Books 24 x 7
Did someone here help you? Click on their post!
"Easy is the path to wisdom for those not blinded by themselves."
===============================================





Similar Threads
Thread Thread Starter Forum Replies Last Post
RESPONSE BUFFER / FLUSH pallone .NET Framework 2.0 3 May 11th, 2008 01:39 PM
flushing buffer in A2K Loralee Access 1 September 26th, 2005 05:44 PM
Buffer Overflow rekha_jsr Oracle 3 February 3rd, 2005 08:11 PM
filling in a buffer JLN VB.NET 2002/2003 Basics 2 July 8th, 2004 08:06 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.