Class RandomAccessXMLReader


  • public class RandomAccessXMLReader
    extends java.lang.Object
    Fast retrieval of strings from a file by byte offset and length as defined by an XMLByteLocation object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String read​(java.io.File file, XMLByteLocation xmlByteLocation)
      Get a String from the provided File using the offset and length from the XMLByteLocation, encoded with the provided charset
      static java.lang.String read​(java.io.File file, XMLByteLocation xmlByteLocation, java.lang.String charset)
      Get a String from the provided File using the offset and length from the XMLByteLocation, encoded with the provided charset
      static java.lang.String read​(java.io.File file, XMLByteLocation xmlByteLocation, java.nio.charset.Charset charset)
      Get a String from the provided File using the offset and length from the XMLByteLocation, encoded with the provided charset
      • Methods inherited from class java.lang.Object

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

      • RandomAccessXMLReader

        public RandomAccessXMLReader()
    • Method Detail

      • read

        public static java.lang.String read​(java.io.File file,
                                            XMLByteLocation xmlByteLocation)
                                     throws java.io.IOException
        Get a String from the provided File using the offset and length from the XMLByteLocation, encoded with the provided charset
        Parameters:
        file - The File to extract data from
        xmlByteLocation - Object containing the byte coordinates
        Returns:
        String representation of the requested bytes
        Throws:
        java.io.IOException
      • read

        public static java.lang.String read​(java.io.File file,
                                            XMLByteLocation xmlByteLocation,
                                            java.lang.String charset)
                                     throws java.io.IOException
        Get a String from the provided File using the offset and length from the XMLByteLocation, encoded with the provided charset
        Parameters:
        file - The file to extract data from
        xmlByteLocation - Object containing the byte coordinates
        charset - Charset to be used when creating the String from extracted bytes
        Returns:
        String representation of the requested bytes
        Throws:
        java.io.IOException
      • read

        public static java.lang.String read​(java.io.File file,
                                            XMLByteLocation xmlByteLocation,
                                            java.nio.charset.Charset charset)
                                     throws java.io.IOException
        Get a String from the provided File using the offset and length from the XMLByteLocation, encoded with the provided charset
        Parameters:
        file - The file to extract data from
        xmlByteLocation - Object containing the byte coordinates
        charset - Charset to be used when creating the String from extracted bytes
        Returns:
        String representation of the requested bytes
        Throws:
        java.io.IOException