private @NotNull ByteArraySequence readFirstBytesFromFile(@NotNull VirtualFile file, int bufferLength) throws IOException {
    try (InputStream inputStream = ((FileSystemInterface)file.getFileSystem()).getInputStream(file)) {
      if (toLog()) {
        log("F: detectFromContentAndCache(" + file.getName() + "):" + " inputStream=" + streamInfo(inputStream));
      }
      int fileLength = (int)Math.min(file.getLength(), bufferLength);
      byte[] content = ArrayUtil.newByteArray(fileLength);
      int n = readSafely(inputStream, content, content.length);
      return n > 0 ? new ByteArraySequence(content, 0, n) : ByteArraySequence.EMPTY;
    }
  }
private @NotNull ByteArraySequence readFirstBytesFromFile(@NotNull VirtualFile file, int bufferLength)