[FIX] peek first character before guessing the format from stream