code: public static Representation create(final File file, final boolean autoDecompress)
              throws IllegalArgumentException {
          try {
              String name = file.getName();
              final Representation representation;
              if (autoDecompress) {
                  byte[] bytes = ByteStreams.toByteArray(IO.read(file.getAbsolutePath()));
                  representation = new Representation(new ByteArrayInputStream(bytes));
                  if (name.endsWith(".gz") || name.endsWith(".xz") || name.endsWith(".7z")) {
                      name = name.substring(0, name.length() - 3);
                  } else if (name.endsWith(".bz2") || name.endsWith(".lz4")) {
                      name = name.substring(0, name.length() - 4);
                  }
              } else {
                  representation = new Representation(IO.buffer(new FileInputStream(file)));
              }
              representation.metadata.set(NFO.FILE_SIZE, file.length());
              representation.metadata.set(NFO.FILE_NAME, name);
              representation.metadata.set(NFO.FILE_LAST_MODIFIED, new Date(file.lastModified()));
              representation.metadata.set(NIE.MIME_TYPE, Data.extensionToMimeType(name));
              return representation;
          } catch (final FileNotFoundException ex) {
              throw new IllegalArgumentException("Not a file: " + file.getAbsolutePath());
          } catch (final IOException e) {
              throw new IllegalArgumentException("IOException on file: " + file.getAbsolutePath());
          }
      }
docs: Creates a representation based on the {@code File} specified. The file length, size,
  creation time and MIME type will be reflected in the returned representation metadata
  (respectively, properties {@link NFO#FILE_SIZE}, {@link NFO#FILE_NAME},
  {@link NFO#FILE_LAST_MODIFIED}, {@link NIE#MIME_TYPE}). Note that this method causes the
  file to be opened for reading.
  
  @param file
  the file containing the binary data of the representation
  @param autoDecompress
  automatically decompress the file, if compressed with gzip, bzip2, xz, 7z or lz4
  @return the created representation
  @throws IllegalArgumentException
  in case the file does not exist