Guest User

Untitled

a guest
Oct 18th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. import org.apache.commons.compress.compressors.bzip2._
  2. import java.io._
  3. import scala.xml.pull._
  4. import scala.io.Source
  5. import scala.Console
  6.  
  7. object reader {
  8.  
  9.  
  10. def main(args: Array[String]) {
  11.  
  12. val fin = new FileInputStream(args(1))
  13. val in = new BufferedInputStream(fin);
  14. val bzIn = new BZip2CompressorInputStream(in);
  15.  
  16. //val stream = Stream.continually(bzIn.read).takeWhile(_ != -1).map(_.toChar)
  17. val src = Source.fromInputStream(bzIn)
  18. val reader = new XMLEventReader(src)
  19.  
  20. while (reader.hasNext)
  21. Console.println(reader.next)
  22. }
  23.  
  24. }
Add Comment
Please, Sign In to add comment