InputStream.BytesAvalilable is missing in B4I, adding this can make porting codes from B4A more easily. Or just InputStream.DataAvailable to know whether have incoming data or not.