title: Why I can still send data after the response is commited with "response.flushBuffer()"?
body: <p>I use the following REST handler to transfer a file to client.</p>
  
  <p>I <strong><em>deliberately</em></strong> called <code>response.flushBuffer()</code> in hope that I should be blocked from writing to the response since it is already committed. And I expect client will not receive the full file.</p>
  
  <p>But the whole file still gets sent to client. And no exception about <code>Response Already Committed</code> is thrown.</p>
  
  <p>Why?</p>
  
  <p>My code:</p>
  
  <pre><code>@RestController
  public class ChunkedTransferAPI {
  
      @Autowired
      ServletContext servletContext;
  
      @RequestMapping(value = "bootfile.efi", method = { RequestMethod.GET, RequestMethod.HEAD })
      public void doHttpBoot(HttpServletResponse response) {
  
          String filename = "/realbootfile.efi";
          try {
              ServletOutputStream output = response.getOutputStream();
  
              InputStream input = servletContext.getResourceAsStream(filename);
              BufferedInputStream bufferedInput = new BufferedInputStream(input);
              int datum = bufferedInput.read();
              while (datum != -1) {
                  output.write(datum);
                  datum = bufferedInput.read();
                  response.flushBuffer(); // &lt;======= HERE
              }
              //output.flush();
              output.close();
  
          } catch (IOException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
      }
  }
  </code></pre>