i have received a http request and want to write the datas to a file (binary)
that me code (VB) to read the buffer
Private Sub mvarWebClient_ResponseReceived(ByVal sender As Gadgeteer.Networking.HttpRequest, ByVal response As Gadgeteer.Networking.HttpResponse) Handles mvarWebClient.ResponseReceived Dim SDbuffer(1) As Byte Do SDbuffer(0) = response.Stream.ReadByte() SDfile.Write(SDbuffer, 0, 1) Debug.Print( response.Stream.Position.ToString + " " + response.Stream.Length.ToString) Loop Until response.Stream.Position = response.Stream.Length - 1
The problem is the stream.position allways point to the first byte i have received.
The debug.print allways print “0 22720” and the buffer allways contains the first byte from the resonse