Add `StreamMessage.of(inputStream, bufferSize)`
See original GitHub issueIt would be nice if we provide a way to convert an InputStream to a StreamMessage<HttpData> that splits the binary by the bufferSize.
static StreamMessage<HttpData> of(InputStream inputStream, ByteBufAllocator alloc, int bufferSize) {...}
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:9 (9 by maintainers)
Top Results From Across the Web
How to control the buffer size while reading from a inputstream
I am reading from an input stream from FileItemIterator iter = upload.getItemIterator(request); while (iter.hasNext()) { FileItemStream item ...
Read more >armeria/StreamMessage.java at master - GitHub
Creates a new {@link StreamMessage} that streams the specified {@link File}. * The default buffer size({@value PathStreamMessage#DEFAULT_FILE_BUFFER_SIZE}) ...
Read more >BufferedInputStream (Java Platform SE 7 ) - Oracle Help Center
A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the input and to support the mark and reset methods.
Read more >Stream - Reference Source - Microsoft
421public override Task CopyToAsync(Stream destination, Int32 bufferSize, CancellationToken ... 57public byte[] ComputeHash(Stream inputStream) {.
Read more >Java BufferedInputStream - Jenkov.com
Except for adding buffering to your input streams, BufferedInputStream behaves exactly like an InputStream . Optimal Buffer Size for a ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@minwoox Could I try my hand at this?
Yes, exactly. 😄 You might want to take a look at https://github.com/line/armeria/blob/master/core/src/main/java/com/linecorp/armeria/server/file/StreamingHttpFile.java because it’s implemented in that way.