Public Sub ReadObject (In As InputStream) As Object
Dim out As OutputStream
out.InitializeToBytesArray(0)
File.Copy2(In, out)
Dim raf2 As RandomAccessFile
raf2.Initialize3(out.ToBytesArray, False)
Dim res As Object = raf2.ReadObject(0)
raf2.Close
Return res
End Sub
I want to do the same with the httpServer in b4a, but can't seem to find how to read the servlet's inputStream. I know I can use the post method, still, it would be nice to do the same, for compatibility reasons. Is it something simple?
Never mind, altered the b4j subroutine, using the getParameter function.
However, I still suppose that it would be nice to add the inputStream to the serverlet object of the b4a lib
You cannot compare B4A HttpServer library to B4J server implementation. B4J server implementation is much more powerful. One of the important differences is that on B4J server multiple requests can be handled at the same time by different threads. This allows you to directly work with the stream.