@@ -0,0 +1,1966 @@
+/*%0A * Copyright 2015-2016 the original author or authors.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.nanoframework.web.server.stream;%0A%0Aimport java.io.IOException;%0Aimport java.util.Scanner;%0A%0Aimport javax.servlet.http.HttpServletRequest;%0A%0Aimport org.nanoframework.web.server.filter.HttpRequestFilter.HttpContext;%0A%0Aimport com.alibaba.fastjson.JSON;%0Aimport com.alibaba.fastjson.TypeReference;%0A%0A/**%0A * %E8%AF%BB%E5%8F%96HttpServletRequest%E4%B8%AD%E7%9A%84%E6%B5%81.%0A * @author yanghe%0A * @since 1.3.10%0A */%0Apublic final class ReadStream %7B%0A%0A    private ReadStream() %7B%0A        %0A    %7D%0A    %0A    /**%0A     * %0A     * @return Request input stream%0A     * @throws IOException if I/O error occur%0A     */%0A    public static String read() throws IOException %7B%0A        final HttpServletRequest request = HttpContext.get(HttpServletRequest.class);%0A        try (final Scanner scanner = new Scanner(request.getInputStream())) %7B%0A            final StringBuilder builder = new StringBuilder();%0A            while(scanner.hasNextLine()) %7B%0A                builder.append(scanner.nextLine());%0A            %7D%0A            %0A            return builder.toString();%0A        %7D%0A    %7D%0A    %0A    /**%0A     * @param %3CT%3E Type%E7%B1%BB%E5%9E%8B%0A     * @param type Alibaba FastJSON TypeReference%0A     * @return T%0A     * @throws IOException if I/O error occur%0A     */%0A    public static %3CT%3E T read(final TypeReference%3CT%3E type) throws IOException %7B%0A        final String stream = read();%0A        return JSON.parseObject(stream, type);%0A    %7D%0A%7D%0A

add ReadStream