// decoding bytes to a String
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.Charset;

byte[] b = ...;
Charset def = Charset.defaultCharset() /* default encoding */;
Charset cs = Charset.forName( "Shift_JIS" /* encoding */ );
ByteBuffer bb = ByteBuffer.wrap( b );
CharBuffer cb = cs.decode( bb );
String s = cb.toString();