iPhone。与 HTTP 服务器建立二进制数据流

发布于 2024-08-03 21:16:10 字数 209 浏览 1 评论 0原文

如何为 iPhone 通过 HTTP 建立输入流?我的项目是将二进制数据从 HTTP 服务器逐步拉取到 iPhone。该模式是提取一些数据 - 这是一个科学应用程序 - 分析一段时间,提取更多数据。冲洗,然后重复。

该项目是桌面 Java 应用程序的一个端口,它依赖于 InputStream 及其方法 readInt、readString 等来执行此操作。

干杯, 道格

How do I establish an input stream over HTTP for the iPhone? My project is to incrementally pull binary data from an HTTP server to the iPhone. The pattern is to pull some data - this is a scientific app - analyze it for a while, pull more data. Rince, and repeat.

This project is a port of a desktop Java app which relies on InputStream and it's methods readInt, readString, etc. to do this.

Cheers,
Doug

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

半世晨晓 2024-08-10 21:16:10

如果您想要一个更直接地反映 Java 输入流的 API,您可能需要看看基于 C 的 CFNetwork。然而,Daniel 建议使用 URL 加载系统(NSURLRequest、NSURLConnection 等)是更好的选择,因为它使用 Objective-C 并且在异步模式下非常易于使用。与简单的 java.io 相比,它更多地打破了旧的 stdio.h 函数,并且非常值得您花时间来理解它。

If you want an API that more directly mirrors the Java input stream, you may want to look at the C-based CFNetwork. However, Daniel's suggestion to use the URL Loading System (NSURLRequest, NSURLConnection, etc.) is preferable because it uses Objective-C and is really easy to use in asynchronous mode. It makes more of a break from the old stdio.h functions than the simplistic java.io does, and it's well worth your time to understand it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文