Improve SimpleStreamingClientHttpRequest performance

Ensure that NonClosingOutputStream calls with a byte array call the
corresponding methods of the underlying OutputStream rather than
relying on the default NonClosingOutputStream implementation, which
writes one bte at a time. This significantly improves performance.

Issues: SPR-9530
This commit is contained in:
Phillip Webb 2012-06-21 17:32:33 -07:00 committed by Rossen Stoyanchev
parent dc822cdca0
commit ecc6a5aed2
1 changed files with 11 additions and 1 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2011 the original author or authors.
* Copyright 2002-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -113,6 +113,16 @@ final class SimpleStreamingClientHttpRequest extends AbstractClientHttpRequest {
super(out);
}
@Override
public void write(byte[] b) throws IOException {
super.write(b);
}
@Override
public void write(byte[] b, int off, int let) throws IOException {
out.write(b, off, let);
}
@Override
public void close() throws IOException {
}