Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose zero-copy file transfer in Servlet API #539

Open
poutsma opened this issue Aug 16, 2023 · 0 comments
Open

Expose zero-copy file transfer in Servlet API #539

poutsma opened this issue Aug 16, 2023 · 0 comments

Comments

@poutsma
Copy link

poutsma commented Aug 16, 2023

It would be nice if the Servlet spec would expose zero-copy file transfer operations, so that files can be written to the network socket without involving the CPU. In Java, zero-copy is exposed through the FileChannel::transferTo methods, but combing this channel-based API with the Servlet spec seems impossible.

For instance, this could take the form of a long transfer(Path file, long pos, long count) method on either ServletResponse or ServletOutputStream, that takes the file path, position and byte count, and returns the bytes written.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant