private @NotNull ByteArraySequence getFirstBytes(@NotNull VirtualFile file, byte @Nullable [] content) throws IOException {
    int bufferLength = getDetectFileBufferSize(file);
    if (content == null) {
      if (bufferLength == 0) {
        return ByteArraySequence.EMPTY;
      }
      try {
        return ProgressManager.getInstance().isInNonCancelableSection() || ApplicationManager.getApplication().isWriteIntentLockAcquired()
               ? readFirstBytesFromFile(file, bufferLength)
               : myReadFirstBytesFromFileRelay.accessDiskWithCheckCanceled(new VirtualFileWithLength(file, bufferLength));
      }
      catch (Exception e) {
        return ByteArraySequence.EMPTY;
      }
    }
    else {
      return content.length != 0 ? new ByteArraySequence(content, 0, Math.min(content.length, bufferLength)) : ByteArraySequence.EMPTY;
    }
  }
private @NotNull ByteArraySequence getFirstBytes(@NotNull VirtualFile file, byte @Nullable [] content)