문제

Are NIO's Channels faster than IO's inputstreams/outputstreams when you want to copy one stream to another? if not when you would use channels?

도움이 되었습니까?

해결책

For most uses it doesn't matter. If you use NIO direct buffers to copy the data is can save a memory copy or two and have a measurable improvement, however I suggest you do what you find simplest and it is likely to be more than fast enough in Java. i.e. you should reach the limits of your network or disk sub-system.

I would start with IOUtils.copy(in, out); and see if this is fast enough.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top