public class test {
    public static void main(String[] args) {
        char[] buffer = new char[10];
        String longString = "This is a very long string that exceeds the buffer size";
        System.out.println(longString.length());
        // Attempt to copy the long string into the buffer
        longString.getChars(0, longString.length(), buffer, 0);
    }
}