private static boolean isSymlink(File file) throws IOException {
        Preconditions.checkNotNull(file);
        File fileInCanonicalDir = null;
        if (file.getParent() == null) {
            fileInCanonicalDir = file;
        } else {
            fileInCanonicalDir = new File(file.getParentFile().getCanonicalFile(), file.getName());
        }
        return !fileInCanonicalDir.getCanonicalFile().equals(fileInCanonicalDir.getAbsoluteFile());
    }
Convert the given byte buffer to a string. The resulting string can be
converted back to the same byte buffer through {@link #stringToBytes(String)}.
indexr-query-opt/src/main/java/org/apache/spark/util/JavaUtils.java