Code example for Charset

Methods: newDecoder

0
     
    private static Charset detectCharset(byte[] bytes, Charset charset)
    { 
        try 
        { 
            CharsetDecoder decoder = charset.newDecoder();
            decoder.reset();
             
            boolean identified = identify(bytes, decoder);
             
            if (identified)
            { 
                return charset;
            } 
            else 
            { 
                return null; 
            } 
             
        } 
        catch (Exception e)