In Swift 3.x, we usually handle binary data using Data
; from it you can generate most other important types, and there are useful functions on it.
But how do I create a Data
from an InputStream
? Is there a nice way?
In Swift 3.x, we usually handle binary data using Data
; from it you can generate most other important types, and there are useful functions on it.
But how do I create a Data
from an InputStream
? Is there a nice way?
above the code, It can be infinite loop. When I convert httpbodyInpustream to data, it happend. So I add a condition.
I could not find a nice way. We can create a nice-ish wrapper around the unsafe stuff:
Find full code with test here.