{
public final static String SIGNATURE_UTF_8 = "UTF-8"; //$NON-NLS-1$
* @param inputStream
* the input stream of the unicode file
*
* @return the encoding signature from the unicode file.
*
* @throws IOException
* if errors occur when reading bytes from the input stream
*/
throws IOException
{
int byte2 = inputStream.read( );
if ( byte1 == 0xFE && byte2 == 0xFF )
{
return SIGNATURE_UNICODE_BIG;
}
else if ( byte1 == 0xFF && byte2 == 0xFE )
{
}
{
return SIGNATURE_UTF_8;
}
if ( byte1 == 0x00 && byte2 == 0x00 && byte3 == 0xFE && byte4 == 0xFF )
{
return SIGNATURE_UCS4_BIG;
}
else if ( byte1 == 0x00 && byte2 == 0x00 && byte3 == 0xFF
&& byte4 == 0xFE )
{
return SIGNATURE_UCS4_LITTLE;
}
return null; //$NON-NLS-1$
}