Class Utility


  • public class Utility
    extends java.lang.Object
    Utility java code
    • Constructor Summary

      Constructors 
      Constructor Description
      Utility()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static long seekBack​(java.io.File f, int count, java.lang.String marker)
      seekBack searches backwards for certain markers in a file, and returns position of the final marker found.
      static long seekBack​(java.io.File f, int count, java.lang.String marker, com.google.common.base.Predicate<java.io.InputStream> validity)
      seekBack searches backwards for certain markers in a file, and returns position of the final marker found.
      • Methods inherited from class java.lang.Object

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

      • Utility

        public Utility()
    • Method Detail

      • seekBack

        public static long seekBack​(java.io.File f,
                                    int count,
                                    java.lang.String marker)
                             throws java.io.IOException
        seekBack searches backwards for certain markers in a file, and returns position of the final marker found. count specifies how many markers to search for. if the search reaches the beginning of the file without finding all of the markers, then 0 is returned.
        Parameters:
        f - the file to search
        count - number of markers to find
        marker - text string marker
        Returns:
        location of marker number count found from the end of the file, or 0
        Throws:
        java.io.IOException
      • seekBack

        public static long seekBack​(java.io.File f,
                                    int count,
                                    java.lang.String marker,
                                    com.google.common.base.Predicate<java.io.InputStream> validity)
                             throws java.io.IOException
        seekBack searches backwards for certain markers in a file, and returns position of the final marker found. count specifies how many markers to search for. if the search reaches the beginning of the file without finding all of the markers, then 0 is returned.
        Parameters:
        f - the file to search
        count - number of markers to find
        marker - text string marker
        validity - predicate to test whether the stream is at a valid position, or null
        Returns:
        location of marker number count found from the end of the file, or 0
        Throws:
        java.io.IOException