Class RandomAccessXMLReader
- java.lang.Object
-
- com.thirdpartylabs.xmlscalpel.io.reader.RandomAccessXMLReader
-
public class RandomAccessXMLReader extends java.lang.ObjectFast retrieval of strings from a file by byte offset and length as defined by anXMLByteLocationobject
-
-
Constructor Summary
Constructors Constructor Description RandomAccessXMLReader()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Stringread(java.io.File file, XMLByteLocation xmlByteLocation)Get aStringfrom the providedFileusing the offset and length from theXMLByteLocation, encoded with the provided charsetstatic java.lang.Stringread(java.io.File file, XMLByteLocation xmlByteLocation, java.lang.String charset)Get aStringfrom the providedFileusing the offset and length from theXMLByteLocation, encoded with the provided charsetstatic java.lang.Stringread(java.io.File file, XMLByteLocation xmlByteLocation, java.nio.charset.Charset charset)Get aStringfrom the providedFileusing the offset and length from theXMLByteLocation, encoded with the provided charset
-
-
-
Method Detail
-
read
public static java.lang.String read(java.io.File file, XMLByteLocation xmlByteLocation) throws java.io.IOExceptionGet aStringfrom the providedFileusing the offset and length from theXMLByteLocation, encoded with the provided charset- Parameters:
file- TheFileto extract data fromxmlByteLocation- 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.IOExceptionGet aStringfrom the providedFileusing the offset and length from theXMLByteLocation, encoded with the provided charset- Parameters:
file- The file to extract data fromxmlByteLocation- Object containing the byte coordinatescharset- Charset to be used when creating theStringfrom 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.IOExceptionGet aStringfrom the providedFileusing the offset and length from theXMLByteLocation, encoded with the provided charset- Parameters:
file- The file to extract data fromxmlByteLocation- Object containing the byte coordinatescharset- Charset to be used when creating the String from extracted bytes- Returns:
- String representation of the requested bytes
- Throws:
java.io.IOException
-
-