public String loadString ( String encoding ) throws IOException { byte [ ] bytes = loadByteArray ( ) ; ByteOrderMask bom = ByteOrderMask . valueOf ( bytes ) ; if ( bom != null ) { int offset = ( bom . getBytes ( ) ) . length ; return new String ( bytes , offset , bytes . length - offset , bom . getEncoding ( ) ) ; } return new String ( bytes , encoding ) ; }
Loads the string in the user specified character encoding .