简体   繁体   中英

Netty Stream URL / InputStream

I'm trying to expand on the functionality here:

https://github.com/netty/netty/tree/3/src/main/java/org/jboss/netty/example/http/file

By providing support to stream URLs instead of Files as the content I'd like to serve is in the classpath within my JAR. Unfortunately I can't seem to figure out a good way to stream a URL or InputStream with Jetty, nor can I find any examples.

Examples or reference to JavaDoc would be appreciated to help get me on the right path.

Just use ChunkedWriteHandler and write an ChunkedStream that wraps the InputStream.

This should work out quite all..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM