Class WriteBytesToFile


  • public class WriteBytesToFile
    extends java.lang.Object
    A class with a method for creating large files. Bruce Eckel's solution (http://www.java2s.com/ExampleCode/File-Input-Output/Creatingaverylargefileusingmapping.htm) is slightly slower!
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void main​(java.lang.String[] args)
      Writes a large number of bytes to a given file.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
                         throws java.io.IOException
        Writes a large number of bytes to a given file.
        Parameters:
        args - args[0] is the number of bytes to write args[1] the name of the output file
        Throws:
        java.io.IOException - If unable to write to output file