Most likely, but you are guaranteed to allocate enough space for it. Would
it be better to not preallocate ad instead let it grow? My knowledge of
Java performance details is quite lacking.

On Monday, October 14, 2013, David Ells wrote:

> In src/main/java/com/rusticisoftware/tincan/RemoteLRS.java:
>
> > @@ -124,6 +137,17 @@ private HTTPResponse sendRequest(HTTPRequest request) throws Exception {
> >          request.setRequestHeader("X-Experience-API-Version", this.getVersion().toString());
> >          request.setRequestContentType("application/json");
> >
> > +        if (this.getCompressionGZip()) {
> > +            request.setRequestHeader("Content-Encoding", "gzip");
> > +
> > +            String content = request.getRequestContent().toString("UTF-8");
> > +            ByteArrayOutputStream baos = new ByteArrayOutputStream(content.length());
>
> Won't you end up with a byte buffer much larger than the one you actually
> need in this case?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/WatershedLRS/TinCanJava/pull/1/files#r6950564>
> .
>