import ch.codeblock.qrinvoice.QrInvoiceCodeParser;
import ch.codeblock.qrinvoice.model.ParseException;
import ch.codeblock.qrinvoice.model.QrInvoice;
import ch.codeblock.qrinvoice.model.validation.ValidationException;
import ch.codeblock.qrinvoice.model.validation.ValidationResult;
import ch.codeblock.qrinvoice.qrcode.DecodeException;
import java.io.InputStream;
import java.math.BigDecimal;
// ...
// either provide an input stream or a byte array
final InputStream imageInputStream = ...;
try {
final QrInvoice qrInvoice = QrInvoiceCodeParser.create().parse(imageInputStream);
// access QR-Invoice structure
final BigDecimal amount = qrInvoice.getPaymentAmountInformation().getAmount();
// ...
} catch (DecodeException e) {
// decoding error handling - e.g. qr code could be found in the given image
} catch (ParseException e) {
// parsing exception handling
}