All Downloads are FREE. Search and download functionalities are using the official Maven repository.

panda.util.chardet.nsDetector Maven / Gradle / Ivy

Go to download

Panda Core is the core module of Panda Framework, it contains commonly used utility classes similar to apache-commons.

There is a newer version: 1.8.0
Show newest version
package panda.util.chardet ;

import java.io.IOException;
import java.io.InputStream;

/**
 * 
 *
 */
public class nsDetector extends nsPSMDetector {

	private String detectedCharset;

	public nsDetector() {
		super();
	}

	public nsDetector(LangHint langHint) {
		super(langHint);
	}

	public boolean DoIt(InputStream ins) throws IOException {
		this.HandleData(ins);
		return mDone;
	}

	public void Done() {
		this.DataEnd();
	}

	public String getDetectedCharset() {
		return detectedCharset;
	}

	protected void Report(String charset) {
		this.detectedCharset = charset;
	}

	public boolean isAscii(byte[] aBuf, int aLen) {
		for (int i = 0; i < aLen; i++) {
			if ((0x0080 & aBuf[i]) != 0) {
				return false;
			}
		}
		return true;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy