hi to All ,
I am reading a Blob from a Sql and output it as a Jpg File but File.Copy2 closes the stream
Is there another option ? not to close the Inputstream ?
thanks AH
I am reading a Blob from a Sql and output it as a Jpg File but File.Copy2 closes the stream
Is there another option ? not to close the Inputstream ?
thanks AH
B4X:
Private Sub ReadBytesFully(In As InputStream, Data() As Byte, Len As Int) As Byte()
Dim count = 0, read As Int
Do While count < Len AND read > -1
read = In.ReadBytes(Data, count, Len - count)
count = count + read
Loop
File.Copy2(In,File.OpenOutput(File.DirRootExternal,"3.jpg",False))
Return Data
End Sub