private boolean maybeServeRange(HttpRequest request, ByteBuffer contents, HttpResponse response) {
        String range = request.header("Range");
        if (null == range) {
            return false;
        }

        Matcher matcher = SINGLE_BYTE_RANGE.matcher(range);
        if (!matcher.matches()) {
            return false;
        }

        String startString = matcher.group(1);
        String endString = matcher.group(2);

        if (null != startString && null != endString) {
            int start = Integer.parseInt(startString);
            int end = Integer.parseInt(endString);
            if (start <= end) {
                serveRange(start,
                        Math.min(contents.remaining() - 1, end),
                        contents,
                        response);
                return true;
            }
        } else if (null != startString) {
            serveRange(Integer.parseInt(startString),
                    contents.remaining() - 1,
                    contents,
                    response);
            return true;
        } else if (null != endString) {
            int end = Integer.parseInt(endString);
            serveRange(contents.remaining() - end,
                    contents.remaining() - 1,
                    contents,
                    response);
            return true;
        }

        return false;
    }