Class IORoutines


  • public class IORoutines
    extends java.lang.Object
    Author:
    J. H. S.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static byte[] LINE_BREAK_BYTES  
    • Constructor Summary

      Constructors 
      Constructor Description
      IORoutines()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean equalContent​(java.io.File file, byte[] content)  
      static byte[] load​(java.io.File file)  
      static byte[] load​(java.io.InputStream in)  
      static byte[] load​(java.io.InputStream in, int initialBufferSize)  
      static java.lang.String loadAsText​(java.io.InputStream in, java.lang.String encoding)  
      static java.lang.String loadAsText​(java.io.InputStream in, java.lang.String encoding, int bufferSize)  
      static byte[] loadExact​(java.io.InputStream in, int length)  
      static java.util.List loadStrings​(java.io.File file)  
      static java.lang.String readLine​(java.io.InputStream in)
      Reads line without buffering.
      static void save​(java.io.File file, byte[] content)  
      static void saveStrings​(java.io.File file, java.util.Collection list)  
      static void touch​(java.io.File file)  
      • Methods inherited from class java.lang.Object

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

      • LINE_BREAK_BYTES

        public static final byte[] LINE_BREAK_BYTES
    • Constructor Detail

      • IORoutines

        public IORoutines()
    • Method Detail

      • loadAsText

        public static java.lang.String loadAsText​(java.io.InputStream in,
                                                  java.lang.String encoding)
                                           throws java.io.IOException
        Throws:
        java.io.IOException
      • loadAsText

        public static java.lang.String loadAsText​(java.io.InputStream in,
                                                  java.lang.String encoding,
                                                  int bufferSize)
                                           throws java.io.IOException
        Throws:
        java.io.IOException
      • load

        public static byte[] load​(java.io.File file)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • load

        public static byte[] load​(java.io.InputStream in)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • load

        public static byte[] load​(java.io.InputStream in,
                                  int initialBufferSize)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • loadExact

        public static byte[] loadExact​(java.io.InputStream in,
                                       int length)
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • equalContent

        public static boolean equalContent​(java.io.File file,
                                           byte[] content)
                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • save

        public static void save​(java.io.File file,
                                byte[] content)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • readLine

        public static java.lang.String readLine​(java.io.InputStream in)
                                         throws java.io.IOException
        Reads line without buffering.
        Throws:
        java.io.IOException
      • touch

        public static void touch​(java.io.File file)
      • saveStrings

        public static void saveStrings​(java.io.File file,
                                       java.util.Collection list)
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • loadStrings

        public static java.util.List loadStrings​(java.io.File file)
                                          throws java.io.IOException
        Throws:
        java.io.IOException