B4A Question A question about job.GetInputStream - Erel (first post)    Mar 11, 2021   (3 reactions) 'Returns the number of bytes skipped
Sub SkipNBytes (Input As InputStream, N As Int) As Int
Dim buffer(Min(N, 8000)) As Byte
Dim count As Int
Do While count < N
Dim read As Int = Input.ReadBytes(buffer, 0, Min(buffer.Length, N - count))
If read = -1 Then Return count
B4J Question jOkHttpUtils2 JobDone answer - Erel (first post)    Nov 01, 2016   (2 reactions) Job.GetInputStream will not help here.
The problem is that your server returns an error status.
Use OkHttpUtils2 source code instead of the library and change hc_ResponseError in HttpUtils2Service to:
Sub hc_ResponseError (Response As OkHttpResponse, Reason As String, StatusCode As Int, TaskId As B4J Question Downloading pictures with non-ui app - aeric (first post)    Jul 21, 2024   (2 reactions) I don't understand why it needs to be so complicated.
How I do is:
Sub DownloadImage
Dim job As HttpJob
job.Initialize("", Me)
job.Download("https://picsum.photos/200/300")
Wait For (job) JobDone(job As HttpJob)
If job.Success Then
Dim inp As InputStream = job.GetInputStr B4A Question Reading a data file 0-255 - ElliotHC (first post)    May 29, 2019 job.GetInputStream.ReadBytes(bytes,0,job.GetInputStream.BytesAvailable)
For x = 0 To job.GetInputStream.BytesAvailable - 1
Log( Bit.And(bytes(x),255))
Log(ToUnsigned(bytes(x)))
Next
So in both cases I'm not seeing values that aren't text. I have a <9> in my B4A Question PDF Viewer From URL - nicieri (first post)    Jul 16, 2024 I may be referring to the pdfium function to load from a stream, but I can't get it to work. Dim url As String = cdata.Get("pdfUrl") Dim job As HttpJob job.Initialize("DownloadPDF", Me) job.Download(url) B4i Question GetInputStream Error HTTPJOB - gerredtor (first post)    May 19, 2016   (1 reaction) The error was this: Public Sub JobDone (Job As HttpResponse)
it was success with: Public Sub JobDone (Job As HttpJob) B4A Question How to download file from remote web server and saved in download folder of mobile? - Rajesh Gupta (first post)    Jul 28, 2017   (1 reaction) Sir I have already done it but still not get any downloaded file.:(
Sub JobDone (job As HttpJob)
If job.JobName="job7" Then
If job.Success Then
Log(job.GetString)
Dim out As OutputStream = File.OpenOutput(File.DirRootExternal, FileName, False)
File. B4A Question HttpJob returns empty InputStream from Job.GetInputStream - ostau (first post)    Jan 27, 2016 Hallo Erel,
thank you for your quick response.
1. I set a breakpoint and watched the variable xx. The buffer is empty (all bytes are 0, see attached screenshot).
2. The parser, which gets the result from the Service returns null. B4A Question Please Help - Download Image From Web - RodrigoVitachi (first post)    Feb 28, 2015 Hey DonManfred, thanks for your reply :)
File.Copy2(job.GetInputStream,OutStream) is giving me exactly the same error, probably the GetInputstream method. B4J Question B4J equivalent code - PatrikCavina (first post)    Jun 03, 2019   (1 reaction) Dim job As HttpJob job.Initialize("", Me) job.Download("http://uplink.duplexfx.com:8800/") Wait For (job) JobDone (job As HttpJob) Dim in As InputStream = job.GetInputStream job.Release Page: 1   2   3   4   5   6   7   Powered by ColBERT |