src/main/java/org/apache/sling/api/request/builder/impl/SlingHttpServletRequestImpl.java [300:385]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    @Override
    public ResourceBundle getResourceBundle(final Locale locale) {
        return getResourceBundle(null, locale);
    }

    @Override
    public ResourceBundle getResourceBundle(final String baseName, final Locale locale) {
        return SlingHttpServletRequestBuilderImpl.EMPTY_RESOURCE_BUNDLE;
    }

    @Override
    public String getCharacterEncoding() {
        return this.builder.characterEncoding;
    }

    @Override
    public void setCharacterEncoding(final String encoding) throws UnsupportedEncodingException {
        this.builder.characterEncoding = encoding;
    }

    @Override
    public String getContentType() {
        if (this.builder.contentType == null) {
            return null;
        } else if (this.builder.characterEncoding == null) {
            return this.builder.contentType;
        }
        return this.builder
                .contentType
                .concat(SlingHttpServletRequestBuilderImpl.CHARSET_SEPARATOR)
                .concat(this.builder.characterEncoding);
    }

    @Override
    public ServletInputStream getInputStream() {
        if (this.builder.getReaderCalled) {
            throw new IllegalStateException();
        }
        this.builder.getInputStreamCalled = true;
        return new ServletInputStream() {
            private final InputStream is = new ByteArrayInputStream(builder.body.getBytes(StandardCharsets.UTF_8));

            @Override
            public int read() throws IOException {
                return is.read();
            }

            @Override
            public boolean isReady() {
                return true;
            }

            @Override
            public boolean isFinished() {
                throw new UnsupportedOperationException();
            }

            @Override
            public void setReadListener(ReadListener readListener) {
                throw new UnsupportedOperationException();
            }
        };
    }

    @Override
    public BufferedReader getReader() {
        if (this.builder.getInputStreamCalled) {
            throw new IllegalStateException();
        }
        this.builder.getReaderCalled = true;
        return new BufferedReader(new StringReader(this.builder.body));
    }

    @Override
    public int getContentLength() {
        return this.builder.body.length();
    }

    @Override
    public long getContentLengthLong() {
        return this.getContentLength();
    }

    @Override
    public RequestDispatcher getRequestDispatcher(final String path) {
        if (this.builder.requestDispatcherProvider != null) {
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



src/main/java/org/apache/sling/api/request/builder/impl/SlingJakartaHttpServletRequestImpl.java [286:371]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    @Override
    public ResourceBundle getResourceBundle(final Locale locale) {
        return getResourceBundle(null, locale);
    }

    @Override
    public ResourceBundle getResourceBundle(final String baseName, final Locale locale) {
        return SlingHttpServletRequestBuilderImpl.EMPTY_RESOURCE_BUNDLE;
    }

    @Override
    public String getCharacterEncoding() {
        return this.builder.characterEncoding;
    }

    @Override
    public void setCharacterEncoding(final String encoding) throws UnsupportedEncodingException {
        this.builder.characterEncoding = encoding;
    }

    @Override
    public String getContentType() {
        if (this.builder.contentType == null) {
            return null;
        } else if (this.builder.characterEncoding == null) {
            return this.builder.contentType;
        }
        return this.builder
                .contentType
                .concat(SlingHttpServletRequestBuilderImpl.CHARSET_SEPARATOR)
                .concat(this.builder.characterEncoding);
    }

    @Override
    public ServletInputStream getInputStream() {
        if (this.builder.getReaderCalled) {
            throw new IllegalStateException();
        }
        this.builder.getInputStreamCalled = true;
        return new ServletInputStream() {
            private final InputStream is = new ByteArrayInputStream(builder.body.getBytes(StandardCharsets.UTF_8));

            @Override
            public int read() throws IOException {
                return is.read();
            }

            @Override
            public boolean isReady() {
                return true;
            }

            @Override
            public boolean isFinished() {
                throw new UnsupportedOperationException();
            }

            @Override
            public void setReadListener(ReadListener readListener) {
                throw new UnsupportedOperationException();
            }
        };
    }

    @Override
    public BufferedReader getReader() {
        if (this.builder.getInputStreamCalled) {
            throw new IllegalStateException();
        }
        this.builder.getReaderCalled = true;
        return new BufferedReader(new StringReader(this.builder.body));
    }

    @Override
    public int getContentLength() {
        return this.builder.body.length();
    }

    @Override
    public long getContentLengthLong() {
        return this.getContentLength();
    }

    @Override
    public RequestDispatcher getRequestDispatcher(final String path) {
        if (this.builder.requestDispatcherProvider != null) {
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



