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

auto-flush added (optional) #1

Closed
wants to merge 1 commit into from

Conversation

idozorenko
Copy link

Adds optional auto-flush possibility, so as checkSize() does not have to be called manually.

@adrian-herscu
Copy link

Why someone would want not to flush "automatically"?
I solved this by wrapping the stream provided by getMultiPartOutputStreams with a FilterOutputStream like this:

final class CheckedMultipartOutputStream
            extends FilterOutputStream {
            CheckedMultipartOutputStream(final OutputStream out) {
                super(out);
            }

            @Override
            @SneakyThrows
            public void write(final byte[] b)
                throws IOException {
                super.write(b);
                out().checkSize();
            }
....

@alexmojaki
Copy link
Owner

Thanks guys, and sorry I never responded to this. There was a time when I thought that checkSize being called too eagerly could lead to malformed data, that was a mistake. I have released a version 2.0 in which the method is no longer public and is called automatically.

@alexmojaki alexmojaki closed this Apr 19, 2019
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

Successfully merging this pull request may close these issues.

None yet

3 participants