net.sf.mmm.util.io.api
Class EncodingDetectionReader

java.lang.Object
  extended by java.io.Reader
      extended by net.sf.mmm.util.io.api.EncodingDetectionReader
All Implemented Interfaces:
Closeable, Readable
Direct Known Subclasses:
EncodingUtilImpl.UtfDetectionReader

public abstract class EncodingDetectionReader
extends Reader

This class represents a Reader that automatically detects an encoding while reading the data. Beside being a regular Reader this class acts as API that additionally allows to get the detected encoding in case you need this information (e.g. to save it as meta-data).

Since:
1.0.1
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)
See Also:
EncodingUtil.createUtfDetectionReader(java.io.InputStream, String)

Field Summary
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
EncodingDetectionReader()
           
 
Method Summary
abstract  String getEncoding()
          This method gets the encoding if already detected.
 
Methods inherited from class java.io.Reader
close, mark, markSupported, read, read, read, read, ready, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EncodingDetectionReader

public EncodingDetectionReader()
Method Detail

getEncoding

public abstract String getEncoding()
This method gets the encoding if already detected. The detection may last until the end of this Reader has been reached.

Returns:
the encoding or null if NOT yet detected (then typically ASCII is assumed so far).


Copyright © 2001-2010 mmm-Team. All Rights Reserved.