title: Sort serial data with buffer
body: <p>Is there any algorithms to sort data from serial input using buffer which is smaller than data length?</p>
  
  <p>For example, I have 100 bytes of serial data, which can be read only once, and 40 bytes buffer. And I need to print out sorted bytes.</p>
  
  <p>I need it in Javascript, but any general ideas are appreciated.</p>