public @NonNull String head(int numChars) throws IOException {
        char[] buf = new char[numChars];
        int read = 0;
        try (Reader r = new FileReader(file)) {
            while (read < numChars) {
                int d = r.read(buf, read, buf.length - read);
                if (d < 0)
                    break;
                read += d;
            }

            return new String(buf, 0, read);
        }
    }
@Test
    public void shortHead() throws Exception {
        File f = tmp.newFile();
        Files.writeString(f.toPath(), "hello", Charset.defaultCharset());

        TextFile t = new TextFile(f);
        assertEquals("hello", t.head(35));
    }