Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4018515

java.io.RandomAccessFile.writeUTF never throws UTFDataFormatError

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      1.1.1
    • CPU:
      sparc
    • OS:
      solaris_2.4, solaris_2.5
    • Verification:
      Not verified

      Description

      ==== Here is the minimized test demonstrating the bug ====
      import java.io.*;
      public class java_io_RandomAccessFile_writeUTF {
        public static void main( String argv[] ) {
          RandomAccessFile f;
          String s="\uffff";
          for (int i=0; i<16; i++)
            s+=s;
          System.out.println("String length= "+s.length());

          try {
            f=new RandomAccessFile("new_file","rw");

            try {
              f.writeUTF(s);
            }
            catch (Error e) {
              System.out.println(e);
            }
            System.out.println("File length now: "+f.length());

          }
          catch (IOException e) {
            System.out.println(e);
          }
        }
       
      }
      ==== Here is the output of the test ====
      String length= 65536
      File length now: 196610

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mr Mark Reinhold
              Reporter:
              mgorshen Mikhail Gorshenev (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: