code: protected void flushCache() throws IOException {
          if (cachePosition > 0) {
              byte[] chunkHeader = (Integer.toHexString(cachePosition) + "\r\n").getBytes(StandardCharsets.US_ASCII);
              stream.write(chunkHeader, 0, chunkHeader.length);
              stream.write(cache, 0, cachePosition);
              stream.write(ENDCHUNK, 0, ENDCHUNK.length);
              cachePosition = 0;
          }
      }
docs: Writes the cache out onto the underlying stream
  @throws IOException
  
  @since 3.0