{"id":278327,"date":"2016-04-14T22:40:02","date_gmt":"2016-04-14T18:40:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=278327"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=278327","title":{"rendered":"\u0428\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0430 Java \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 7.1 \u0422\u0438\u043f\u043e\u0432\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438: \u041e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f InputStream \u0432 \u0441\u0442\u0440\u043e\u043a\u0443"},"content":{"rendered":"<p>       <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/5ac\/b9a\/7fb\/5acb9a7fb1954a63990ee23a70dc124b.png\"\/>  <\/p>\n<p>\u0423 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u0445\u043e\u0431\u0431\u0438: \u044f \u0441\u043e\u0431\u0438\u0440\u0430\u044e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u043e\u0432\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u0432 Java, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0445\u043e\u0436\u0443 \u0432 \u0438\u043d\u0435\u0442\u0435, \u0438 \u043f\u044b\u0442\u0430\u044e\u0441\u044c \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0443\/\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438\/\u044d\u043b\u0435\u0433\u0430\u043d\u0442\u043d\u043e\u0441\u0442\u0438. \u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043f\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0442\u0430\u043a\u0443\u044e \u0442\u0438\u043f\u043e\u0432\u0443\u044e \u0437\u0430\u0434\u0430\u0447, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0447\u0430\u0441\u0442\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043d\u0430 Java \u043a\u0430\u043a &quot;\u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 InputStream \u0432 \u0441\u0442\u0440\u043e\u043a\u0443&quot; \u0438 \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0435\u0451 \u0440\u0435\u0448\u0435\u043d\u0438\u044f. <\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a\u0438\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0435\u0441\u0442\u044c \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e (\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438\/\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 unicode \u0438 \u0442.\u0434.). \u0410\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 <a href=\"http:\/\/stackoverflow.com\/a\/35446009\/4318868\">\u043c\u043e\u0435\u043c \u043e\u0442\u0432\u0435\u0442\u0435 \u043d\u0430 stackoverflow<\/a>. \u0422\u0435\u0441\u0442\u044b \u0432 \u043c\u043e\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043d\u0430 <a href=\"https:\/\/github.com\/Vedenin\/java_in_examples\/blob\/master\/perfomance_test\/src\/main\/java\/com\/github\/vedenin\/perfomace_test\/ConvertInputStreamToStringBenchmark.java\">github<\/a>. <\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041e\u0431\u0449\u0435\u0435 \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u0435 &#39;\u0428\u043f\u0430\u0440\u0433\u0430\u043b\u043e\u043a&#39;<\/b><\/p>\n<div class=\"spoiler_text\">\n<p><a href=\"https:\/\/habrahabr.ru\/post\/265061\/\">1. JPA \u0438 Hibernate \u0432 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u0445 \u0438 \u043e\u0442\u0432\u0435\u0442\u0430\u0445<\/a><br \/>  <a href=\"https:\/\/habrahabr.ru\/post\/266821\/\">2. \u0422\u0440\u0438\u0441\u0442\u0430 \u043f\u044f\u0442\u044c\u0434\u0435\u0441\u044f\u0442 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u043d\u0435 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 Java opensource \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043d\u0430 github <\/a><br \/>  <a href=\"https:\/\/habrahabr.ru\/company\/luxoft\/blog\/256877\/\">3. \u041a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0432 Java (\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435, guava, apache, trove, gs-collections \u0438 \u0434\u0440\u0443\u0433\u0438\u0435) <\/a><br \/>  <a href=\"https:\/\/habrahabr.ru\/company\/luxoft\/blog\/270383\/\">4. Java Stream API<\/a><br \/>  <a href=\"https:\/\/habrahabr.ru\/company\/luxoft\/blog\/272025\/\">5. \u0414\u0432\u0435\u0441\u0442\u0438 \u043f\u044f\u0442\u044c\u0434\u0435\u0441\u044f\u0442 \u0440\u0443\u0441\u0441\u043a\u043e\u044f\u0437\u044b\u0447\u043d\u044b\u0445 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0445 \u0432\u0438\u0434\u0435\u043e \u0434\u043e\u043a\u043b\u0430\u0434\u043e\u0432 \u0438 \u043b\u0435\u043a\u0446\u0438\u0439 \u043e Java<\/a><br \/>  <a href=\"https:\/\/habrahabr.ru\/company\/luxoft\/blog\/280784\/\">6. \u0421\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0441\u0441\u044b\u043b\u043e\u043a \u0434\u043b\u044f Java \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430<\/a><br \/>  7 \u0422\u0438\u043f\u043e\u0432\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438<br \/>  &nbsp;&nbsp;<a href=\"https:\/\/habrahabr.ru\/post\/278233\/\"> 7.1 \u041e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f InputStream \u0432 \u0441\u0442\u0440\u043e\u043a\u0443<\/a><\/p>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0435\u0449\u0451 \u043d\u0435 \u0432\u0438\u0434\u0435\u043b\u0438, \u0441\u043e\u0432\u0435\u0442\u0443\u044e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e <a href=\"https:\/\/habrahabr.ru\/company\/luxoft\/blog\/280784\/\">\u0421\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0441\u0441\u044b\u043b\u043e\u043a \u0434\u043b\u044f Java \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430<\/a>, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u0430\u044f \u0438\u0437 \u0432\u0441\u0435\u0445 \u043c\u043e\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2>\u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 InputStream \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 (String)<\/h2>\n<p>  <\/p>\n<p>\u041e\u0447\u0435\u043d\u044c \u0447\u0430\u0441\u0442\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0449\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a\u0438\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c (\u0438\u0445 \u0431\u0443\u0434\u0435\u0442 11):<\/p>\n<p>  <\/p>\n<ol>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <strong>IOUtils.toString<\/strong> \u0438\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <code>Apache Commons<\/code>. \u041e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0445 \u043e\u0434\u043d\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u0438\u043a\u043e\u0432.<\/p>\n<p>  <\/p>\n<pre><code>String result = IOUtils.toString(inputStream, StandardCharsets.UTF_8);<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <strong>CharStreams<\/strong> \u0438\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <code>guava<\/code>. \u0422\u043e\u0436\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0434\u043d\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u0438\u043a.<\/p>\n<p>  <\/p>\n<pre><code>String result = CharStreams.toString(new InputStreamReader(       inputStream, Charsets.UTF_8));<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <code>Scanner<\/code> (<strong>JDK<\/strong>). \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u043a\u043e\u0440\u043e\u0442\u043a\u043e\u0435, \u0445\u0438\u0442\u0440\u043e\u0435, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0447\u0438\u0441\u0442\u043e\u0433\u043e JDK, \u043d\u043e \u044d\u0442\u043e \u0441\u043a\u043e\u0440\u0435\u0435 \u0445\u0430\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u043d\u0435\u0441\u0435\u0442 \u043c\u043e\u0437\u0433 \u0442\u0435\u043c \u043a\u0442\u043e \u043e \u0442\u0430\u043a\u043e\u043c \u0444\u043e\u043a\u0443\u0441\u0435 \u043d\u0435 \u0437\u043d\u0430\u0435\u0442. <\/p>\n<p>  <\/p>\n<pre><code>Scanner s = new Scanner(inputStream).useDelimiter(&quot;\\\\A&quot;); String result = s.hasNext() ? s.next() : &quot;&quot;;<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <strong>Stream Api<\/strong> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>Java 8<\/code>. <strong>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435<\/strong>: \u041e\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u044b \u0441\u0442\u0440\u043e\u043a\u0438 (\u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a <code>\\r\\n<\/code>) \u043d\u0430 <code>\\n<\/code>, \u0438\u043d\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e. <\/p>\n<p>  <\/p>\n<pre><code>String result = new BufferedReader(new InputStreamReader(inputStream))   .lines().collect(Collectors.joining(&quot;\\n&quot;));<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <strong>parallel Stream Api<\/strong> (<code>Java 8<\/code>). <strong>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435<\/strong>: \u041a\u0430\u043a \u0438 4 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043e\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u044b \u0441\u0442\u0440\u043e\u043a\u0438 (\u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a <code>\\r\\n<\/code>) \u043d\u0430 <code>\\n<\/code>. <\/p>\n<p>  <\/p>\n<pre><code>String result = new BufferedReader(new InputStreamReader(inputStream)).lines()    .parallel().collect(Collectors.joining(&quot;\\n&quot;));<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <strong>InputStreamReader<\/strong> \u0438 <strong>StringBuilder<\/strong> \u0438\u0437 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e <code>JDK<\/code><\/p>\n<p>  <\/p>\n<pre><code>final int bufferSize = 1024; final char[] buffer = new char[bufferSize]; final StringBuilder out = new StringBuilder(); Reader in = new InputStreamReader(inputStream, &quot;UTF-8&quot;); for (; ; ) {     int rsz = in.read(buffer, 0, buffer.length);     if (rsz &lt; 0)         break;     out.append(buffer, 0, rsz); } return out.toString();<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <strong>StringWriter<\/strong> \u0438 <strong>IOUtils.copy<\/strong> \u0438\u0437 <code>Apache Commons<\/code><\/p>\n<p>  <\/p>\n<pre><code>StringWriter writer = new StringWriter(); IOUtils.copy(inputStream, writer, &quot;UTF-8&quot;); return writer.toString();<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <strong>ByteArrayOutputStream<\/strong> \u0438 <strong>inputStream.read<\/strong> \u0438\u0437 <code>JDK<\/code><\/p>\n<p>  <\/p>\n<pre><code>ByteArrayOutputStream result = new ByteArrayOutputStream(); byte[] buffer = new byte[1024]; int length; while ((length = inputStream.read(buffer)) != -1) {     result.write(buffer, 0, length); } return result.toString(&quot;UTF-8&quot;);<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <strong>BufferedReader<\/strong> \u0438\u0437 <code>JDK<\/code>. <strong>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435<\/strong>: \u042d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u044b \u0441\u0442\u0440\u043e\u043a (\u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a <code>\\n\\r<\/code>) \u043d\u0430 <code>line.separator<\/code> system property (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 Windows \u043d\u0430 &quot;\\r\\n&quot;).<\/p>\n<p>  <\/p>\n<pre><code>String newLine = System.getProperty(&quot;line.separator&quot;); BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream)); StringBuilder result = new StringBuilder(); String line; boolean flag = false; while ((line = reader.readLine()) != null) {     result.append(flag? newLine: &quot;&quot;).append(line);     flag = true; } return result.toString();<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <strong>BufferedInputStream<\/strong> \u0438 <strong>ByteArrayOutputStream<\/strong> \u0438\u0437 <code>JDK<\/code><\/p>\n<p>  <\/p>\n<pre><code>BufferedInputStream bis = new BufferedInputStream(inputStream); ByteArrayOutputStream buf = new ByteArrayOutputStream(); int result = bis.read(); while(result != -1) {     buf.write((byte) result);     result = bis.read(); } return buf.toString();<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <strong>inputStream.read()<\/strong> \u0438 <strong>StringBuilder<\/strong> (<code>JDK<\/code>). <strong>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435<\/strong>: \u042d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 Unicode, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u0440\u0443\u0441\u0441\u043a\u0438\u043c \u0442\u0435\u043a\u0441\u0442\u043e\u043c <\/p>\n<p>  <\/p>\n<pre><code>int ch; StringBuilder sb = new StringBuilder(); while((ch = inputStream.read()) != -1)     sb.append((char)ch); reset(); return sb.toString();<\/code><\/pre>\n<p>  <\/li>\n<\/ol>\n<p>  <\/p>\n<h3><strong>\u0418\u0442\u0430\u043a \u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438<\/strong>:<\/h3>\n<p>  <\/p>\n<ol>\n<li>\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u044f <code>4<\/code>, <code>5<\/code> \u0438 <code>9<\/code> \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044e \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u044b \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u043e\u0434\u043d\u0443.<\/p>\n<p>  <\/li>\n<li>\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u044f <code>11<\/code> \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 Unicode \u0442\u0435\u043a\u0441\u0442\u043e\u043c<\/p>\n<p>  <\/li>\n<li>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 <code>1<\/code>, <code>7<\/code> \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <strong>Apache Commons<\/strong>, <code>2<\/code> \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <strong>Guava<\/strong>, <code>4<\/code> \u0438 <code>5<\/code> \u0442\u0440\u0435\u0431\u0443\u044e\u0442 Java 8 \u0438 \u0432\u044b\u0448\u0435, <\/li>\n<\/ol>\n<p>  <\/p>\n<h3><strong>\u0417\u0430\u043c\u0435\u0440\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438<\/strong><\/h3>\n<p>  <\/p>\n<p><strong>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435<\/strong>: \u0437\u0430\u043c\u0435\u0440\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u0438\u043b\u044c\u043d\u043e \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u0437\u0430\u043c\u0435\u0440\u0430 \u0438 \u0442.\u043f. \u042f \u0438\u0437\u043c\u0435\u0440\u044f\u043b \u043d\u0430 \u0434\u0432\u0443\u0445 \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430\u0445, \u043e\u0434\u0438\u043d Windows 8.1, Intel i7-4790 CPU 3.60GHz<em>2, 16Gb, \u0432\u0442\u043e\u0440\u043e\u0439 \u2014 Linux Mint 17.2, Celeron Dual-Core T3500 2.10Ghz<\/em>2, 6Gb, \u043e\u0434\u043d\u0430\u043a\u043e \u043d\u0435 \u043c\u043e\u0433\u0443 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0447\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u0439 \u0438\u0441\u0442\u0438\u043d\u043e\u0439, \u0432\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u0442\u0435\u0441\u0442\u044b (<a href=\"https:\/\/github.com\/Vedenin\/java_in_examples\/blob\/master\/perfomance_test\/src\/main\/java\/com\/github\/vedenin\/perfomace_test\/ConvertInputStreamToStringBenchmark.java\">test1<\/a> \u0438 <a href=\"https:\/\/github.com\/Vedenin\/java_in_examples\/blob\/master\/perfomance_test\/src\/main\/java\/com\/github\/vedenin\/perfomace_test\/ConvertInputStreamToStringBigBenchmark.java\">test2<\/a>) \u043d\u0430 \u0432\u0430\u0448\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435.<\/p>\n<p>  <\/p>\n<p>\u0417\u0430\u043c\u0435\u0440\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0441\u0442\u0440\u043e\u043a (\u0434\u043b\u0438\u043d\u0430 = 175), \u0442\u0435\u0441\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 <a href=\"https:\/\/github.com\/Vedenin\/java_in_examples\/blob\/master\/perfomance_test\/src\/main\/java\/com\/github\/vedenin\/perfomace_test\/ConvertInputStreamToStringBenchmark.java\">github<\/a> (\u0440\u0435\u0436\u0438\u043c = \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f (AverageTime), \u0441\u0438\u0441\u0442\u0435\u043c\u0430 = Linux Mint 17.2, Celeron Dual-Core T3500 2.10Ghz*2, 6Gb, \u0447\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0438\u0436\u0435 \u0442\u0435\u043c \u043b\u0443\u0447\u0448\u0435, 1,343 \u2014 \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0435\u0435):<\/p>\n<p>  <\/p>\n<pre><code>              Benchmark                        Mode  Cnt   Score   Error  Units 8. ByteArrayOutputStream and read (JDK)        avgt   10   1,343 \u00b1 0,028  us\/op 6. InputStreamReader and StringBuilder (JDK)   avgt   10   6,980 \u00b1 0,404  us\/op 10.BufferedInputStream, ByteArrayOutputStream  avgt   10   7,437 \u00b1 0,735  us\/op 11.InputStream.read() and StringBuilder (JDK)  avgt   10   8,977 \u00b1 0,328  us\/op 7. StringWriter and IOUtils.copy (Apache)      avgt   10  10,613 \u00b1 0,599  us\/op 1. IOUtils.toString (Apache Utils)             avgt   10  10,605 \u00b1 0,527  us\/op 3. Scanner (JDK)                               avgt   10  12,083 \u00b1 0,293  us\/op 2. CharStreams (guava)                         avgt   10  12,999 \u00b1 0,514  us\/op 4. Stream Api (Java 8)                         avgt   10  15,811 \u00b1 0,605  us\/op 9. BufferedReader (JDK)                        avgt   10  16,038 \u00b1 0,711  us\/op 5. parallel Stream Api (Java 8)                avgt   10  21,544 \u00b1 0,583  us\/op<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u043c\u0435\u0440\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0441\u0442\u0440\u043e\u043a (\u0434\u043b\u0438\u043d\u0430 = 50100), \u0442\u0435\u0441\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 <a href=\"https:\/\/github.com\/Vedenin\/java_in_examples\/blob\/master\/perfomance_test\/src\/main\/java\/com\/github\/vedenin\/perfomace_test\/ConvertInputStreamToStringBigBenchmark.java\">github<\/a> (\u0440\u0435\u0436\u0438\u043c = \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f (AverageTime), \u0441\u0438\u0441\u0442\u0435\u043c\u0430 = Linux Mint 17.2, Celeron Dual-Core T3500 2.10Ghz*2, 6Gb, \u0447\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0438\u0436\u0435 \u0442\u0435\u043c \u043b\u0443\u0447\u0448\u0435, 200,715 \u2014 \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0435\u0435):<\/p>\n<p>  <\/p>\n<pre><code>              Benchmark                        Mode  Cnt   Score        Error  Units 8. ByteArrayOutputStream and read (JDK)        avgt   10   200,715 \u00b1   18,103  us\/op 1. IOUtils.toString (Apache Utils)             avgt   10   300,019 \u00b1    8,751  us\/op 6. InputStreamReader and StringBuilder (JDK)   avgt   10   347,616 \u00b1  130,348  us\/op 7. StringWriter and IOUtils.copy (Apache)      avgt   10   352,791 \u00b1  105,337  us\/op 2. CharStreams (guava)                         avgt   10   420,137 \u00b1   59,877  us\/op 9. BufferedReader (JDK)                        avgt   10   632,028 \u00b1   17,002  us\/op 5. parallel Stream Api (Java 8)                avgt   10   662,999 \u00b1   46,199  us\/op 4. Stream Api (Java 8)                         avgt   10   701,269 \u00b1   82,296  us\/op 10.BufferedInputStream, ByteArrayOutputStream  avgt   10   740,837 \u00b1    5,613  us\/op 3. Scanner (JDK)                               avgt   10   751,417 \u00b1   62,026  us\/op 11.InputStream.read() and StringBuilder (JDK)  avgt   10  2919,350 \u00b1 1101,942  us\/op<\/code><\/pre>\n<p>  <\/p>\n<p>\u0413\u0440\u0430\u0444\u0438\u043a \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043e\u0442 \u0434\u043b\u0438\u043d\u044b \u0441\u0442\u0440\u043e\u043a\u0438, \u0441\u0438\u0441\u0442\u0435\u043c\u0430 Windows 8.1, Intel i7-4790 CPU 3.60GHz 3.60GHz, 16Gb:<br \/>  <a href=\"http:\/\/i.stack.imgur.com\/AYYhz.png\"><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/AYYhz.png\" alt=\"enter image description here\"\/><\/a><\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u0431\u043b\u0438\u0446\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043e\u0442 \u0434\u043b\u0438\u043d\u044b \u0441\u0442\u0440\u043e\u043a\u0438, \u0441\u0438\u0441\u0442\u0435\u043c\u0430 Windows 8.1, Intel i7-4790 CPU 3.60GHz 3.60GHz, 16Gb:<\/p>\n<p>  <\/p>\n<pre><code> \u0434\u043b\u0438\u043d\u043d\u0430  182    546     1092    3276    9828    29484   58968   test8  0.38    0.938   1.868   4.448   13.412  36.459  72.708  test4  2.362   3.609   5.573   12.769  40.74   81.415  159.864  test5  3.881   5.075   6.904   14.123  50.258  129.937 166.162  test9  2.237   3.493   5.422   11.977  45.98   89.336  177.39  test6  1.261   2.12    4.38    10.698  31.821  86.106  186.636  test7  1.601   2.391   3.646   8.367   38.196  110.221 211.016  test1  1.529   2.381   3.527   8.411   40.551  105.16  212.573  test3  3.035   3.934   8.606   20.858  61.571  118.744 235.428  test2  3.136   6.238   10.508  33.48   43.532  118.044 239.481  test10 1.593   4.736   7.527   20.557  59.856  162.907 323.147  test11 3.913   11.506  23.26   68.644  207.591 600.444 1211.545<\/code><\/pre>\n<p>  <\/p>\n<h3><strong>\u0412\u044b\u0432\u043e\u0434\u044b<\/strong><\/h3>\n<p>  <\/p>\n<ol>\n<li>\n<p>\u0421\u0430\u043c\u044b\u043c \u0431\u044b\u0441\u0442\u0440\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u0432\u043e \u0432\u0441\u0435\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0438 \u0432\u0441\u0435\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f 8 \u0442\u0435\u0441\u0442: \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <strong>ByteArrayOutputStream<\/strong> \u0438 <strong>inputStream.read<\/strong> \u0438\u0437 <code>JDK<\/code><\/p>\n<p>  <\/p>\n<pre><code>ByteArrayOutputStream result = new ByteArrayOutputStream(); byte[] buffer = new byte[1024]; int length; while ((length = inputStream.read(buffer)) != -1) {     result.write(buffer, 0, length); } return result.toString(&quot;UTF-8&quot;);<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u043c \u0438 \u0432\u0435\u0441\u044c\u043c\u0430 \u0431\u044b\u0441\u0442\u0440\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 IOUtils.toString \u0438\u0437 <code>Apache Commons<\/code> <\/p>\n<p>  <\/p>\n<pre><code>String result = IOUtils.toString(inputStream, StandardCharsets.UTF_8);<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>Stream Api \u0438\u0437 Java 8 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f, \u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0442\u0440\u0438\u043c\u043e\u0432 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u0438\u043d\u0430\u0447\u0435 \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u0434\u043e\u043b\u0433\u043e (\u0447\u0442\u043e \u0432 \u043e\u0431\u0449\u0435\u043c-\u0442\u043e \u0431\u044b\u043b\u043e \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e) <\/p>\n<p>  <\/li>\n<li>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 11 \u043b\u0443\u0447\u0448\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435 \u0432\u0441\u0435\u0445 \u0438 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 Unicode,<\/li>\n<\/ol>\n<p>  <\/p>\n<h3><strong>P.S.<\/strong><\/h3>\n<p>  <\/p>\n<ol>\n<li>\u0410\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 <a href=\"http:\/\/stackoverflow.com\/a\/35446009\/4318868\">\u043c\u043e\u0435\u043c \u043e\u0442\u0432\u0435\u0442\u0435 \u043d\u0430 stackoverflow<\/a>. \u0422\u0435\u0441\u0442\u044b \u0432 \u043c\u043e\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043d\u0430 <a href=\"https:\/\/github.com\/Vedenin\/java_in_examples\/blob\/master\/perfomance_test\/src\/main\/java\/com\/github\/vedenin\/perfomace_test\/ConvertInputStreamToStringBenchmark.java\">github<\/a>. \u0415\u0441\u043b\u0438 \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0432\u0430\u043c \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u0430\u0441\u044c \u0438 \u0432\u044b \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u0435 \u043f\u043b\u044e\u0441 \u043d\u0430 stackoverflow\/\u0437\u0432\u0435\u0437\u0434\u0443 \u043d\u0430 github&#8217;\u0435 \u0431\u0443\u0434\u0443 \u0432\u0430\u043c \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u0435\u043d. <\/li>\n<li>\u0411\u0443\u0434\u0443 \u043e\u0447\u0435\u043d\u044c \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u0435\u043d \u0437\u0430 \u043b\u044e\u0431\u044b\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f, \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f InputStream \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 <\/li>\n<li>\u0415\u0441\u043b\u0438 \u0432\u044b \u0435\u0449\u0451 \u043d\u0435 \u0432\u0438\u0434\u0435\u043b\u0438, \u0441\u043e\u0432\u0435\u0442\u0443\u044e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e <a href=\"https:\/\/habrahabr.ru\/company\/luxoft\/blog\/280784\/\">\u0421\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0441\u0441\u044b\u043b\u043e\u043a \u0434\u043b\u044f Java \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430<\/a>, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u0430\u044f \u0438\u0437 \u0432\u0441\u0435\u0445 \u043c\u043e\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442.<\/li>\n<\/ol>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041e\u0431\u0449\u0435\u0435 \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u0435 &#39;\u0428\u043f\u0430\u0440\u0433\u0430\u043b\u043e\u043a&#39;<\/b><\/p>\n<div class=\"spoiler_text\">\n<p><a href=\"https:\/\/habrahabr.ru\/post\/265061\/\">1. JPA \u0438 Hibernate \u0432 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u0445 \u0438 \u043e\u0442\u0432\u0435\u0442\u0430\u0445<\/a><br \/>  <a href=\"https:\/\/habrahabr.ru\/post\/266821\/\">2. \u0422\u0440\u0438\u0441\u0442\u0430 \u043f\u044f\u0442\u044c\u0434\u0435\u0441\u044f\u0442 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u043d\u0435 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 Java opensource \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043d\u0430 github <\/a><br \/>  <a href=\"https:\/\/habrahabr.ru\/company\/luxoft\/blog\/256877\/\">3. \u041a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0432 Java (\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435, guava, apache, trove, gs-collections \u0438 \u0434\u0440\u0443\u0433\u0438\u0435) <\/a><br \/>  <a href=\"https:\/\/habrahabr.ru\/company\/luxoft\/blog\/270383\/\">4. Java Stream API<\/a><br \/>  <a href=\"https:\/\/habrahabr.ru\/company\/luxoft\/blog\/272025\/\">5. \u0414\u0432\u0435\u0441\u0442\u0438 \u043f\u044f\u0442\u044c\u0434\u0435\u0441\u044f\u0442 \u0440\u0443\u0441\u0441\u043a\u043e\u044f\u0437\u044b\u0447\u043d\u044b\u0445 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0445 \u0432\u0438\u0434\u0435\u043e \u0434\u043e\u043a\u043b\u0430\u0434\u043e\u0432 \u0438 \u043b\u0435\u043a\u0446\u0438\u0439 \u043e Java<\/a><br \/>  <a href=\"https:\/\/habrahabr.ru\/company\/luxoft\/blog\/280784\/\">6. \u0421\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0441\u0441\u044b\u043b\u043e\u043a \u0434\u043b\u044f Java \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430<\/a><br \/>  7 \u0422\u0438\u043f\u043e\u0432\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438<br \/>  &nbsp;&nbsp;<a href=\"https:\/\/habrahabr.ru\/post\/278233\/\"> 7.1 \u041e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f InputStream \u0432 \u0441\u0442\u0440\u043e\u043a\u0443<\/a><\/p>\n<\/div>\n<\/div>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/278233\/\"> https:\/\/habrahabr.ru\/post\/278233\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/5ac\/b9a\/7fb\/5acb9a7fb1954a63990ee23a70dc124b.png\"\/>  <\/p>\n<p>\u0423 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u0445\u043e\u0431\u0431\u0438: \u044f \u0441\u043e\u0431\u0438\u0440\u0430\u044e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u043e\u0432\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u0432 Java, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0445\u043e\u0436\u0443 \u0432 \u0438\u043d\u0435\u0442\u0435, \u0438 \u043f\u044b\u0442\u0430\u044e\u0441\u044c \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0443\/\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438\/\u044d\u043b\u0435\u0433\u0430\u043d\u0442\u043d\u043e\u0441\u0442\u0438. \u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043f\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0442\u0430\u043a\u0443\u044e \u0442\u0438\u043f\u043e\u0432\u0443\u044e \u0437\u0430\u0434\u0430\u0447, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0447\u0430\u0441\u0442\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043d\u0430 Java \u043a\u0430\u043a &quot;\u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 InputStream \u0432 \u0441\u0442\u0440\u043e\u043a\u0443&quot; \u0438 \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0435\u0451 \u0440\u0435\u0448\u0435\u043d\u0438\u044f. <\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a\u0438\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0435\u0441\u0442\u044c \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e (\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438\/\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 unicode \u0438 \u0442.\u0434.). \u0410\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 <a href=\"http:\/\/stackoverflow.com\/a\/35446009\/4318868\">\u043c\u043e\u0435\u043c \u043e\u0442\u0432\u0435\u0442\u0435 \u043d\u0430 stackoverflow<\/a>. \u0422\u0435\u0441\u0442\u044b \u0432 \u043c\u043e\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043d\u0430 <a href=\"https:\/\/github.com\/Vedenin\/java_in_examples\/blob\/master\/perfomance_test\/src\/main\/java\/com\/github\/vedenin\/perfomace_test\/ConvertInputStreamToStringBenchmark.java\">github<\/a>. <\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041e\u0431\u0449\u0435\u0435 \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u0435 &#39;\u0428\u043f\u0430\u0440\u0433\u0430\u043b\u043e\u043a&#39;<\/b><\/p>\n<div class=\"spoiler_text\">\n<p><a href=\"https:\/\/habrahabr.ru\/post\/265061\/\">1. JPA \u0438 Hibernate \u0432 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u0445 \u0438 \u043e\u0442\u0432\u0435\u0442\u0430\u0445<\/a><br \/>  <a href=\"https:\/\/habrahabr.ru\/post\/266821\/\">2. \u0422\u0440\u0438\u0441\u0442\u0430 \u043f\u044f\u0442\u044c\u0434\u0435\u0441\u044f\u0442 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u043d\u0435 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 Java opensource \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043d\u0430 github <\/a><br \/>  <a href=\"https:\/\/habrahabr.ru\/company\/luxoft\/blog\/256877\/\">3. \u041a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0432 Java (\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435, guava, apache, trove, gs-collections \u0438 \u0434\u0440\u0443\u0433\u0438\u0435) <\/a><br \/>  <a href=\"https:\/\/habrahabr.ru\/company\/luxoft\/blog\/270383\/\">4. Java Stream API<\/a><br \/>  <a href=\"https:\/\/habrahabr.ru\/company\/luxoft\/blog\/272025\/\">5. \u0414\u0432\u0435\u0441\u0442\u0438 \u043f\u044f\u0442\u044c\u0434\u0435\u0441\u044f\u0442 \u0440\u0443\u0441\u0441\u043a\u043e\u044f\u0437\u044b\u0447\u043d\u044b\u0445 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0445 \u0432\u0438\u0434\u0435\u043e \u0434\u043e\u043a\u043b\u0430\u0434\u043e\u0432 \u0438 \u043b\u0435\u043a\u0446\u0438\u0439 \u043e Java<\/a><br \/>  <a href=\"https:\/\/habrahabr.ru\/company\/luxoft\/blog\/280784\/\">6. \u0421\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0441\u0441\u044b\u043b\u043e\u043a \u0434\u043b\u044f Java \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430<\/a><br \/>  7 \u0422\u0438\u043f\u043e\u0432\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438<br \/>  &nbsp;&nbsp;<a href=\"https:\/\/habrahabr.ru\/post\/278233\/\"> 7.1 \u041e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f InputStream \u0432 \u0441\u0442\u0440\u043e\u043a\u0443<\/a><\/p>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0435\u0449\u0451 \u043d\u0435 \u0432\u0438\u0434\u0435\u043b\u0438, \u0441\u043e\u0432\u0435\u0442\u0443\u044e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e <a href=\"https:\/\/habrahabr.ru\/company\/luxoft\/blog\/280784\/\">\u0421\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0441\u0441\u044b\u043b\u043e\u043a \u0434\u043b\u044f Java \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430<\/a>, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u0430\u044f \u0438\u0437 \u0432\u0441\u0435\u0445 \u043c\u043e\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-278327","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/278327","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=278327"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/278327\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=278327"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=278327"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=278327"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}