Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 23rd, 2006, 06:07 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default Data Type Question

Hello all,
    I have a general question about the byte datatype, though this will get a little complex at the end. Now I know that when I declare a variable as a byte that it consumes 1byte of memory, so does that mean if I declare a byte array of say 100 that it is using 100 bytes?

Next question is in regards to streams, I am reading data into a byte array (text and binary data) and this is fine until I reach a stream that has more then 1MB of data in it. Streams that are <= 999KB do not cause me a problem, anything larger then that causes me application to fail. (The aspnet_wp.exe terminates in the task manager, however, this isnt due to an out of memory error as the process maintains its current memory usage and my server still has ~800mb avail) So the question is, do byte arrays have a max limit that, if you go past a certain point, it causes an overflow?

My work around to this was to create a filestream and stream the byte data to a text file as it was coming down, and this works like a charm, except when i got to retrieve the data. I write the buffer directly to the filestream, it is inside of that stream that the byte gets converted to its character representation automatically. Now when this stream is done I close it for writing and open it for reading and read the stream into a string, now i want to convert that string back to its byte representation so i use System.Text.Encoding.Default.GetBytes(string) somewhere between the writing and the converting my data gets corrupted and I dont know why. The reason i know this is because I wrote out both the original byte array length and the string length and then also the byte array length that i populate from the string. My second byte array is always substanitally smaller then my original byte array, can anyone please explain this to me???





"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."
===============================================
 


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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about value class type saadli BOOK: Ivor Horton's Beginning Visual C++ 2008 ISBN: 978-0-470-22590-5 4 December 3rd, 2008 10:15 PM
Nullable Type Question Aaron Edwards ASP.NET 2.0 Professional 1 August 30th, 2007 07:37 AM
Research Type Question nadee Oracle 0 March 18th, 2007 11:12 PM
"Compiler Options" Question (Newbie-Type) DaveLeeNC Access VBA 2 February 20th, 2006 08:09 AM
Data Type error but it is the correct type Mitch SQL Server 2000 2 March 19th, 2004 11:31 AM



All times are GMT -4. The time now is 10:44 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.