←Older revision | Revision as of 20:51, 7 February 2009 | ||
Line 14: | Line 14: | ||
</source> | </source> | ||
- | I explain this unnecessary complexity as a result of an ''extreme search for correctness''. Plus a little bit of | + | I explain this unnecessary complexity as a result of an ''extreme search for correctness''. Plus a little bit of [[Copy Based Design]]. Reading done in the [[Java]] way almost completely mimics the [[C]] style. E.g. ''malloc'' a bit of memory, read data into it, process them, read additional data, etc. This [[C]] way is known to be correct, never exhaust available memory and be robust even for use in operating systems. As such the designers of the [[Java]] I/O libraries just copied this correct and well-working principle. |
=== Prehistoric I/O === | === Prehistoric I/O === | ||
Line 24: | Line 24: | ||
For a while I was advocating the [[Java]] I/O library to be enhanced with simple reading utility methods. However that takes time. We are not going to have such methods sooner then [[JDK]] 7 is out. But few weeks ago I realized that we do not need to wait! The [[NetBeans]] project has own ''virtual filesystem'' library and we can add the methods there! Today I started an [[APIReview|API review]] to provide simple I/O reading [[API]] (see issue [http://openide.netbeans.org/issues/show_bug.cgi?id=157362 157362]) in the '''FileObject''' class. | For a while I was advocating the [[Java]] I/O library to be enhanced with simple reading utility methods. However that takes time. We are not going to have such methods sooner then [[JDK]] 7 is out. But few weeks ago I realized that we do not need to wait! The [[NetBeans]] project has own ''virtual filesystem'' library and we can add the methods there! Today I started an [[APIReview|API review]] to provide simple I/O reading [[API]] (see issue [http://openide.netbeans.org/issues/show_bug.cgi?id=157362 157362]) in the '''FileObject''' class. | ||
- | Users of [[NetBeans]] 7.0 [[API]]s, say farewell to painful reading of files! And please accept my apology for using | + | Users of [[NetBeans]] 7.0 [[API]]s, say farewell to painful reading of files! And please accept my apology for using [[Copy Based Design]] and realizing only recently that our users could benefit from our own simple [http://bits.netbeans.org/dev/javadoc/org-openide-filesystems/org/openide/filesystems/FileObject.html#asText() asText()], [http://bits.netbeans.org/dev/javadoc/org-openide-filesystems/org/openide/filesystems/FileObject.html#asBytes() asBytes()], and [http://bits.netbeans.org/dev/javadoc/org-openide-filesystems/org/openide/filesystems/FileObject.html#asLines() asLines()] utility methods. |
<comments/> | <comments/> |