I get a null pointer exception in the code of AsyncStreamsObject on the following place:
The function is called as follows:
The file exists.
The error occurs on the line: Dim raf .... The key="Webcam"; the name = empty.
I use AsyncStreamsObject version 1.1 and jRandomAccessFile version 2.30.
Harry
B4X:
Public Sub WriteFile (Key As String, Dir As String, FileName As String)
Dim len As Long = File.Size(Dir, FileName)
If len = 0 Then
Log("Error getting file size.")
Return
End If
Dim name(1) As String
Dim raf As RandomAccessFile = sharedWrite(Key, name)
raf.WriteByte(TYPE_FILE, raf.CurrentPosition)
sharedWriteComplete(raf, name(0))
astream.WriteStream(File.OpenInput(Dir, FileName), len)
End Sub
The function is called as follows:
B4X:
Sub SendFile
If File.Exists("/home/pi/MyApps/Domo/Images","Webcam" & ImageNr & ".jpg") = True Then
Stream3.WriteFile("Webcam","/home/pi/MyApps/Domo/Images","Webcam" & ImageNr & ".jpg")
Else
Stream2.Write("-4"& CRLF)
End If
End Sub
The file exists.
The error occurs on the line: Dim raf .... The key="Webcam"; the name = empty.
I use AsyncStreamsObject version 1.1 and jRandomAccessFile version 2.30.
Harry
Last edited: