So this looks like a fancy way of using an if statement to check if bom.getCharsetName()
actually returns a valid character set name. However, it is quite confusing and I've never seen this syntax before. How does this break down piece by piece?
String charsetName = bom == null ? defaultEncoding : bom.getCharsetName();