code: public InputStream openInputStream()
      throws IOException
    {
      close();
  
      TempBuffer head = _head;
      _head = null;
      _tail = null;
  
      return new TempInputStream(head);
    }
docs: Opens a read stream to the buffer.