Index: /gs2-extensions/video-and-audio/trunk/src/opt/Terrier/ImageDocument.java
===================================================================
--- /gs2-extensions/video-and-audio/trunk/src/opt/Terrier/ImageDocument.java	(revision 26189)
+++ /gs2-extensions/video-and-audio/trunk/src/opt/Terrier/ImageDocument.java	(revision 26190)
@@ -17,14 +17,7 @@
 package org.terrier.indexing;
 
-import java.io.BufferedOutputStream;
-import java.io.BufferedReader;
-import java.io.FileOutputStream;
 import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.IOException;
-import java.io.PrintWriter;
 import java.io.StringReader;
 import java.io.Reader;
-import java.lang.Thread;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -36,4 +29,5 @@
 
 import org.apache.log4j.Logger;
+import org.terrier.indexing.StreamGobbler;
 import org.terrier.indexing.tokenisation.TokenStream;
 import org.terrier.indexing.tokenisation.Tokeniser;
@@ -260,53 +254,2 @@
 }
 
-class StreamGobbler
-extends Thread
-{
-  InputStream is;
-  String file_path;
-  boolean output_to_file;
-
-  StreamGobbler(InputStream is)
-  {
-    this.is = is;
-    this.output_to_file = false;
-  }
-
-  StreamGobbler(InputStream is, String file_path)
-  {
-    this.is = is;
-    this.file_path = file_path;
-    this.output_to_file = true;
-  }
-
-  public void run()
-  {
-    try
-    {
-      InputStreamReader isr = new InputStreamReader(is);
-      BufferedReader br = new BufferedReader(isr);
-      String line = null;
-      if (output_to_file)
-      {
-        PrintWriter pw = new PrintWriter(new BufferedOutputStream(new FileOutputStream(file_path)));
-        while ( (line = br.readLine()) != null)
-        {
-          pw.println(line);
-        }
-        pw.flush();
-        pw.close();
-      }
-      else
-      {
-        while ( (line  = br.readLine()) != null)
-        {
-          // Do nothing - equivalent to > /dev/null
-        }
-      }
-    }
-    catch (IOException ioe)
-    {
-      ioe.printStackTrace();
-    }
-  }
-}
Index: /gs2-extensions/video-and-audio/trunk/src/opt/Terrier/VideoDocument.java
===================================================================
--- /gs2-extensions/video-and-audio/trunk/src/opt/Terrier/VideoDocument.java	(revision 26189)
+++ /gs2-extensions/video-and-audio/trunk/src/opt/Terrier/VideoDocument.java	(revision 26190)
@@ -17,12 +17,9 @@
 package org.terrier.indexing;
 
-import java.io.BufferedOutputStream;
 import java.io.BufferedReader;
 import java.io.File;
-import java.io.FileOutputStream;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.IOException;
-import java.io.PrintWriter;
 import java.io.StringReader;
 import java.io.Reader;
@@ -43,4 +40,5 @@
 
 import org.apache.log4j.Logger;
+import org.terrier.indexing.StreamGobbler;
 import org.terrier.indexing.tokenisation.TokenStream;
 import org.terrier.indexing.tokenisation.Tokeniser;
@@ -392,55 +390,2 @@
   /** getReader() **/
 }
-
-class StreamGobbler
-extends Thread
-{
-  InputStream is;
-  String file_path;
-  boolean output_to_file;
-
-  StreamGobbler(InputStream is)
-  {
-    this.is = is;
-    this.output_to_file = false;
-  }
-
-  StreamGobbler(InputStream is, String file_path)
-  {
-    this.is = is;
-    this.file_path = file_path;
-    this.output_to_file = true;
-  }
-
-  public void run()
-  {
-    try
-    {
-      InputStreamReader isr = new InputStreamReader(is);
-      BufferedReader br = new BufferedReader(isr);
-      String line = null;
-      if (output_to_file)
-      {
-        PrintWriter pw = new PrintWriter(new BufferedOutputStream(new FileOutputStream(file_path)));
-        while ( (line = br.readLine()) != null)
-        {
-          pw.println(line);
-        }
-        pw.flush();
-        pw.close();
-      }
-      else
-      {
-        while ( (line  = br.readLine()) != null)
-        {
-          // Do nothing - equivalent to > /dev/null
-        }
-      }
-    }
-    catch (IOException ioe)
-    {
-      ioe.printStackTrace();
-    }
-  }
-}
-
