Help please, use writeInt to write the length of the array in a text document, but the number is not displayed in the notebook (the symbol of an empty square)
public static void outputPupils(Pupil v, OutputStream out) throws IOException { DataOutputStream stream = new DataOutputStream(out); stream.writeInt(v.getSecn().length()); stream.close(); } Main:
OutputStream fout = new FileOutputStream("C:\\Users\\Sfroe\\Desktop\\output.txt"); Pupils.outputPupils(sb, fout); getSecn returns the student's last name.
writeInt, and in the codewriteByte? What doesv.getSecn.length()return? What did you expect to see in the file? - default locale