/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* See LICENSE.txt included in this distribution for the specific
* language governing permissions and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at LICENSE.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/**
* A {@link FileAnalyzer}, which tries to determine and use the charset of the
* input to analyze wrt. UTF-16 and UTF-8. If the charset cannot be detected,
* the platforms default charset will be used.
*
* @author Chris Eldredge
* @version $Revision$
*/
/**
* Create a new instance.
* @param factory factory to use for fallback settings.
*/
super(factory);
}
/**
* {@inheritDoc}
*/
byte[] head = new byte[3];
if (br >= 2 &&
charset = "UTF-16";
// InputStreamReader does not properly discard BOM on UTF8 streams,
// so don't reset the stream.
charset = "UTF-8";
}
}
}
/**
* Analyze the source provided by the given reader and store results into
* the given document. NOTE: This method does not close the given reader
* on return!
*
* @param doc where to store results
* @param reader reader which provides the source to analyze.
* @throws IOException
*/
}