Class UniversalDetector


  • public final class UniversalDetector
    extends java.lang.Object
    UniversalDetector.
    • Field Detail

      • done

        private boolean done
      • start

        private boolean start
      • gotData

        private boolean gotData
      • lastChar

        private byte lastChar
      • detectedCharset

        private java.lang.String detectedCharset
    • Constructor Detail

      • UniversalDetector

        public UniversalDetector()
        Constructor.
    • Method Detail

      • isDone

        public boolean isDone()
        Gets the completition status.
        Returns:
        true if it is done, false otherwise.
      • getDetectedCharset

        public java.lang.String getDetectedCharset()
        Gets the detected charset.
        Returns:
        The detected encoding is returned. If the detector couldn't determine what encoding was used, null is returned.
      • handleData

        public void handleData​(byte[] buf,
                               int offset,
                               int length)
        Handle data.
        Parameters:
        buf - Data to handle.
        offset - Initial data offset.
        length - Data length.
      • dataEnd

        public void dataEnd()
        Indicate the end of data input.
      • reset

        private void reset()