you cannot set a line length if the FileWriter and PrintWriter classes. To have this feature I would extends the class and provide the functionality you want.
For example, you might create a method setMaxLineLength(int l), and override the print(String s) and println(String s) methods. If a String is passed with length greater than the maxLineLength, then split the String up into lengths less than or equal to the maxLinLength and use the super.println(String s) call.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.