473,503 Members | 3,715 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Putting stream text data into a string possible without a fixed-sized buffer?

Hi,

I do a webrequest and it returns some text data in a stream. I want to
put this tyext data into a string. I've got it working just fine, but
I have to put the text data into into a fixed-size buffer BEFORE I put
it into a string (ConstBufferByteSize=1000000). This fixed size buffer
wastes space. Is it possible to somehow assign it straight to a
string, or somehow do this 'dynamically' ?
'' Put the XML response into a string to display
Dim tempBuffer(ConstBufferByteSize) As Byte
Dim enc As New System.Text.ASCIIEncoding

responseStream.Read(tempBuffer, 0,
ConstBufferByteSize) ' Read from the stream x bytes and put into a
temporary buffer

responseStream.Close() ' Close
the request stream to free up resources

strResponse =
enc.GetString(tempBuffer) ' Put the response into
a string (finally!)
' responseStream.Length.ToString() ' <- Can't get the
length to signify the buffer size ???

Any kind of help will do,

thankyou

Jack.

Jul 20 '07 #1
0 1295

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

Similar topics

1
2099
by: R.G. Vervoort | last post by:
Is it possible to change selected text in a textarea without using java and only php or html. There are lots of solutions in a javascript but i would like to try it without. If it is possible to...
5
8574
by: adrian | last post by:
hi all this is my first post to this group, so pls bear with me while i try to make some sense. i am trying to create a sproc which uses dynamic sql to target a particuar table eg. '.' and...
1
359
by: Rohit Sharma | last post by:
Hi All, I want to catch a stream as a string.....please see below: Dim stXML As Stream Dim sReturn as string dsResult.WriteXml(stXML) I want the value of the stream stXML as a string....
1
1761
by: Ola Theander | last post by:
Dear subscribers I'm currently creating a small application that will run at the end of a web installation to configure a SQL Server. For this task I have a SQL batch file in the same format...
3
5064
by: Wade G. Pemberton | last post by:
Help!: I use javascript to format repetitive data from a web page input FORM into a long string , and save it as lines of comma delimited data in a text file on a Unix server. The text...
5
17084
by: Fernando Rodríguez | last post by:
Hi, How can I read everything inside a Stream into a String or StringBuilder? O:-) TIA
5
23656
by: ywchan | last post by:
I would like to convert a string to a fixed length e.g. if fixed length = 10 'abc' -> ' abc' 'abcdefghijklm' -> 'abcdefghij' Is there any simple function in C# can perform this operation?...
4
1607
by: ad | last post by:
I have a Steam, it read from a text file. How can I convert this Stream to a String?
6
41542
by: John Dinning | last post by:
In 'C' it was possible to format a string to a fixed length, e.g. to 10 characters: printf("%10.10s","123456789012345"); would return "1234567890", and printf("%10.10s","12345"); would...
0
1003
by: hd95 | last post by:
I have an rss download stream I am parsing using the xmltextreader object. I am finding that lone ampersands and dashes in the content are screwing up the parsing process. If someone knows how to...
0
7192
marktang
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,...
0
7261
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6974
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...
0
7445
tracyyun
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...
0
5559
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4991
isladogs
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...
0
4665
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1492
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 ...
1
721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.