HTTPCLIENT-2112: AbstractMultipartFormat respects ByteBuffer.arrayOffset (#253)

This commit is contained in:
Carter Kozak 2020-08-28 08:05:32 -04:00 committed by GitHub
parent fa08f54077
commit 45c45d53e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -50,7 +50,7 @@ abstract class AbstractMultipartFormat {
final Charset charset, final String string) {
final ByteBuffer encoded = charset.encode(CharBuffer.wrap(string));
final ByteArrayBuffer bab = new ByteArrayBuffer(encoded.remaining());
bab.append(encoded.array(), encoded.position(), encoded.remaining());
bab.append(encoded.array(), encoded.arrayOffset() + encoded.position(), encoded.remaining());
return bab;
}