@NotNull
    private BOMInputStream buildBomInputStream(final InputStream inputStream,
                                               final boolean includeByteOrderMark,
                                               final String encoding) {
        // Set up the BOMs that the input stream should look for
        final ByteOrderMark[] byteOrderMarks;
        if (encoding.equalsIgnoreCase(StandardCharsets.UTF_8.name())) {
            byteOrderMarks = new ByteOrderMark[]{ByteOrderMark.UTF_8};
        } else if (encoding.equalsIgnoreCase(StandardCharsets.UTF_16LE.name())) {
            byteOrderMarks = new ByteOrderMark[]{ByteOrderMark.UTF_16LE};
        } else if (encoding.equalsIgnoreCase(StandardCharsets.UTF_16BE.name())) {
            byteOrderMarks = new ByteOrderMark[]{ByteOrderMark.UTF_16BE};
        } else if (encoding.toUpperCase().startsWith("UTF-16")) {
            byteOrderMarks = new ByteOrderMark[]{ByteOrderMark.UTF_16LE, ByteOrderMark.UTF_16BE};
        } else if (encoding.toUpperCase().startsWith("UTF-32")) {
            byteOrderMarks = new ByteOrderMark[]{ByteOrderMark.UTF_32LE, ByteOrderMark.UTF_32BE};
        } else {
            byteOrderMarks = null;
        }

        if (byteOrderMarks != null) {
            return new BOMInputStream(
                    inputStream,
                    includeByteOrderMark,
                    byteOrderMarks);
        } else {
            return new BOMInputStream(inputStream, includeByteOrderMark);
        }
    }
@param inputStream          The stream to read from. This reader will not close the stream.
@param includeByteOrderMark If true, any BOM in the stream will be included.
@param encoding             The character encoding name of the stream.
stroom-data/stroom-data-store-impl/src/main/java/stroom/data/store/impl/CharReader.java