public static String toStringUTF8(byte[] bytes, int offset, int length)
    {
        if (bytes == null)
        {
            return null;
        }

        try
        {
            return new String(bytes, offset, length, "UTF-8");
        }
        catch (UnsupportedEncodingException e)
        {
            // This never happens.
            return null;
        }
        catch (IndexOutOfBoundsException e)
        {
            return null;
        }
    }
public static String toStringUTF8 ( byte [ ] bytes , int offset , int length ) { if ( bytes == null ) { return null ; } try { return new String ( bytes , offset , length , "UTF-8" ) ; } catch ( UnsupportedEncodingException e ) { return null ; } catch ( IndexOutOfBoundsException e ) { return null ; } }
Convert a UTF-8 byte array into a string.