Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

STream Reader and buffer

Posted on 2013-06-27
6
Medium Priority
?
334 Views
Last Modified: 2013-06-27
In my code below, is there a way I can set the readBuff dynamically?

While streamResponse.CanRead
    Dim streamRead As New StreamReader(streamResponse)
    Dim readBuff(5120) As [Char]
    Dim count As Integer = streamRead.Read(readBuff, 0, 5120)

Etc...

Open in new window

0
Comment
Question by:lrbrister
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 42

Assisted Solution

by:sedgwick
sedgwick earned 2000 total points
ID: 39281122
Dim size as Integer = 5120
Dim readBuff(size) As [Char]

Open in new window

0
 
LVL 25

Expert Comment

by:Luis Pérez
ID: 39281126
Can you please explain better what's your problem?
0
 
LVL 42

Expert Comment

by:sedgwick
ID: 39281130
u can use a variable instead the number when u initialize the array.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:lrbrister
ID: 39281162
Ok guys...
So there's no dynamic setting of the number based on the Stream itself?
0
 
LVL 42

Accepted Solution

by:
sedgwick earned 2000 total points
ID: 39281166
nop.
there's no Length or Size property of StreamReader
http://msdn.microsoft.com/en-us/library/system.io.streamreader_fields.aspx
if u have control of the response stream, u can decide that the 1st 4 bytes of the stream is the length.
so u read the 1st 4 bytes of the responseStream, init the array and read the rest of the stream.
0
 

Author Closing Comment

by:lrbrister
ID: 39281216
Thanks
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question