code: public static CompoundTag readFile(File file, boolean compressed, boolean littleEndian) throws IOException {
          InputStream in = new FileInputStream(file);
          if(compressed) {
              in = new GZIPInputStream(in);
          }
  
          Tag tag = readTag(in, littleEndian);
          if(!(tag instanceof CompoundTag)) {
              throw new IOException("Root tag is not a CompoundTag!");
          }
  
          return (CompoundTag) tag;
      }
docs: Reads the root CompoundTag from the given file.
  
  @param file         File to read from.
  @param compressed   Whether the NBT file is compressed.
  @param littleEndian Whether the NBT file is little endian.
  @return The read compound tag.
  @throws java.io.IOException If an I/O error occurs.