javatools.filehandlers
Class ByteFileLines

java.lang.Object
  extended by javatools.datatypes.PeekIterator<java.lang.String>
      extended by javatools.filehandlers.FileLines
          extended by javatools.filehandlers.ByteFileLines
All Implemented Interfaces:
java.io.Closeable, java.lang.Iterable<java.lang.String>, java.util.Iterator<java.lang.String>

public class ByteFileLines
extends FileLines

This class is part of the Java Tools (see http://mpii.de/yago-naga/javatools). It is licensed under the Creative Commons Attribution License (see http://creativecommons.org/licenses/by/3.0) by the YAGO-NAGA team (see http://mpii.de/yago-naga). Does the same as FileLines (see there) but reads bytes (see SimpleInputStreamReader).


Nested Class Summary
 
Nested classes/interfaces inherited from class javatools.datatypes.PeekIterator
PeekIterator.ElementaryPeekIterator<T>, PeekIterator.SimplePeekIterator<T>
 
Field Summary
 java.io.InputStream in
          The stream to read the lines from
 
Fields inherited from class javatools.filehandlers.FileLines
maxChars
 
Fields inherited from class javatools.datatypes.PeekIterator
closed, initialized, next
 
Constructor Summary
ByteFileLines(java.io.BufferedInputStream i)
          Constructs FileLines from a BufferedReader (main constructor 2)
ByteFileLines(java.io.File f)
          Constructs FileLines from a file
ByteFileLines(java.io.File f, java.lang.String announceMsg)
          Constructs FileLines from a file, shows progress bar (main constructor 1)
ByteFileLines(java.io.InputStream i)
          Constructs FileLines from a Reader
ByteFileLines(java.lang.String f)
          Constructs FileLines from a filename
ByteFileLines(java.lang.String f, java.lang.String announceMsg)
          Constructs FileLines from a filename, shows progress bar
 
Method Summary
 void close()
          Closes the reader
 java.lang.String internalNext()
          Returns next line.
static void main(java.lang.String[] args)
           
 
Methods inherited from class javatools.filehandlers.FileLines
finalize, find, find, findIgnoreCase, firstCharAfterSpace, iterator, numAllFileLines, numFileLines, readBetween, readBetween, readTo, readTo, readTo, readTo, readToBoundary, readToSpace, remove, scrollTo, scrollTo, scrollTo, toString
 
Methods inherited from class javatools.datatypes.PeekIterator
asList, asList, asSet, asSet, asSet, emptyIterator, hasNext, list, list, next, nextOrNull, numElements, numElements, peek, toString, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Iterator
hasNext, next
 

Field Detail

in

public java.io.InputStream in
The stream to read the lines from

Constructor Detail

ByteFileLines

public ByteFileLines(java.lang.String f)
              throws java.io.IOException
Constructs FileLines from a filename

Throws:
java.io.IOException

ByteFileLines

public ByteFileLines(java.io.File f)
              throws java.io.IOException
Constructs FileLines from a file

Throws:
java.io.IOException

ByteFileLines

public ByteFileLines(java.lang.String f,
                     java.lang.String announceMsg)
              throws java.io.IOException
Constructs FileLines from a filename, shows progress bar

Throws:
java.io.IOException

ByteFileLines

public ByteFileLines(java.io.File f,
                     java.lang.String announceMsg)
              throws java.io.IOException
Constructs FileLines from a file, shows progress bar (main constructor 1)

Throws:
java.io.IOException

ByteFileLines

public ByteFileLines(java.io.InputStream i)
Constructs FileLines from a Reader


ByteFileLines

public ByteFileLines(java.io.BufferedInputStream i)
Constructs FileLines from a BufferedReader (main constructor 2)

Method Detail

internalNext

public java.lang.String internalNext()
Description copied from class: FileLines
Returns next line. In case of an IOException, the exception is wrapped in a RuntimeException

Overrides:
internalNext in class FileLines

close

public void close()
Description copied from class: FileLines
Closes the reader

Specified by:
close in interface java.io.Closeable
Overrides:
close in class FileLines

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception