private void processFile(final Store streamStore, final long streamId, final String match) {
        try (final Source streamSource = streamStore.openSource(streamId)) {
            try (final InputStreamProvider inputStreamProvider = streamSource.get(0)) {
                try (final InputStream inputStream = inputStreamProvider.get()) {

                    // Build up 2 buffers so we can output the content either side
                    // of
                    // the matching line
                    final ArrayDeque<String> preBuffer = new ArrayDeque<>();
                    final ArrayDeque<String> postBuffer = new ArrayDeque<>();

                    final LineNumberReader lineNumberReader = new LineNumberReader(
                            new InputStreamReader(inputStream, StreamUtil.DEFAULT_CHARSET));

                    String aline;
                    while ((aline = lineNumberReader.readLine()) != null) {
                        String[] lines = {aline};
                        if (addLineBreak != null) {
                            lines = aline.split(addLineBreak);
                        }

                        for (final String line : lines) {
                            if (match == null) {
                                System.out.println(lineNumberReader.getLineNumber() + ":" + line);
                            } else {
                                postBuffer.add(lineNumberReader.getLineNumber() + ":" + line);

                                if (postBuffer.size() > 5) {
                                    final String searchLine = postBuffer.pop();

                                    checkMatch(match, preBuffer, postBuffer, searchLine);

                                    preBuffer.add(searchLine);

                                    if (preBuffer.size() > 5) {
                                        preBuffer.pop();
                                    }
                                }
                            }
                        }

                    }

                    // Look at the end
                    while (postBuffer.size() > 0) {
                        final String searchLine = postBuffer.pop();

                        checkMatch(match, preBuffer, postBuffer, searchLine);

                        preBuffer.add(searchLine);

                        if (preBuffer.size() > 5) {
                            preBuffer.pop();
                        }
                    }
                }
            }
        } catch (final IOException | RuntimeException e) {
            e.printStackTrace();
        }
    }
Handy tool to grep out content.
stroom-data/stroom-data-store-util/src/main/java/stroom/data/store/util/StreamGrepTool.java