Code example for CharsetDecoder

Methods: decode

0
        	if(bytesread == 0)
        	{ 
        		return false; 
        	} 
        	buf.flip();
        	String s = decoder.decode(buf).toString().replaceAll("\\r|\\n", ""); // removes newline
        	 
        	// In case multiple window lists are recieved, use the newest 
        	String[] temp = s.split("\\|\\|");
        	windows = temp[temp.length-1];
        	 
        	buf.clear();
        	return true; 
        } 
    } 
}