Class File.CharsetTesterThread

java.lang.Object
net.sf.basedb.core.File.CharsetTesterThread
All Implemented Interfaces:
Runnable
Enclosing class:
File

class File.CharsetTesterThread
extends Object
implements Runnable
  • Field Details

  • Constructor Details

  • Method Details

    • run

      public void run()
      Runs in a separate thread.
      Specified by:
      run in interface Runnable
    • getCharset

      public Charset getCharset()
    • couldParse

      public boolean couldParse()
      Returns TRUE if the file seems like valid (UTF-8). Note that this may not be correct until the close() method has been called.
    • write

      public void write​(byte[] b, int off, int len)
      Runs in the main thread. Copy bytes to charset detector via the piped streams.
    • write

      public void write​(int b)
      Runs in the main thread. Copy bytes to charset detector via the piped streams.
    • close

      public void close()
      The file has been uploaded. Wait for the charset detector threas to finish and the close everything.