This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-io.git
The following commit(s) were added to refs/heads/master by this push: new 8f7a643 Sort new method. 8f7a643 is described below commit 8f7a6430d535b0227fc25cb917af94b9339c3b19 Author: Gary Gregory <gardgreg...@gmail.com> AuthorDate: Tue Oct 19 11:21:50 2021 -0400 Sort new method. --- src/main/java/org/apache/commons/io/IOUtils.java | 66 ++++++++++++------------ 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/main/java/org/apache/commons/io/IOUtils.java b/src/main/java/org/apache/commons/io/IOUtils.java index 24726e2..3aa0720 100644 --- a/src/main/java/org/apache/commons/io/IOUtils.java +++ b/src/main/java/org/apache/commons/io/IOUtils.java @@ -981,39 +981,6 @@ public class IOUtils { } /** - * Copies bytes from a {@link java.io.ByteArrayOutputStream} to a {@code QueueInputStream}. - * <p> - * Unlike using JDK {@link java.io.PipedInputStream} and {@link java.io.PipedOutputStream} for this, this - * solution works safely in a single thread environment. - * </p> - * <p> - * Example usage: - * </p> - * - * <pre> - * ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - * outputStream.writeBytes("hello world".getBytes(StandardCharsets.UTF_8)); - * - * InputStream inputStream = IOUtils.copy(outputStream); - * </pre> - * - * @param outputStream the {@link java.io.ByteArrayOutputStream} to read. - * @return the {@code QueueInputStream} filled with the content of the outputStream. - * @throws NullPointerException if the {@link java.io.ByteArrayOutputStream} is {@code null}. - * @throws IOException if an I/O error occurs. - * @since 2.12 - */ - @SuppressWarnings("resource") // streams are closed by the caller. - public static QueueInputStream copy(final java.io.ByteArrayOutputStream outputStream) throws IOException { - Objects.requireNonNull(outputStream, "outputStream"); - - final QueueInputStream in = new QueueInputStream(); - outputStream.writeTo(in.newQueueOutputStream()); - - return in; - } - - /** * Copies bytes from an {@code InputStream} to an {@code OutputStream} using an internal buffer of the * given size. * <p> @@ -1113,6 +1080,39 @@ public class IOUtils { } /** + * Copies bytes from a {@link java.io.ByteArrayOutputStream} to a {@code QueueInputStream}. + * <p> + * Unlike using JDK {@link java.io.PipedInputStream} and {@link java.io.PipedOutputStream} for this, this + * solution works safely in a single thread environment. + * </p> + * <p> + * Example usage: + * </p> + * + * <pre> + * ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + * outputStream.writeBytes("hello world".getBytes(StandardCharsets.UTF_8)); + * + * InputStream inputStream = IOUtils.copy(outputStream); + * </pre> + * + * @param outputStream the {@link java.io.ByteArrayOutputStream} to read. + * @return the {@code QueueInputStream} filled with the content of the outputStream. + * @throws NullPointerException if the {@link java.io.ByteArrayOutputStream} is {@code null}. + * @throws IOException if an I/O error occurs. + * @since 2.12 + */ + @SuppressWarnings("resource") // streams are closed by the caller. + public static QueueInputStream copy(final java.io.ByteArrayOutputStream outputStream) throws IOException { + Objects.requireNonNull(outputStream, "outputStream"); + + final QueueInputStream in = new QueueInputStream(); + outputStream.writeTo(in.newQueueOutputStream()); + + return in; + } + + /** * Copies chars from a {@code Reader} to a {@code Appendable}. * <p> * This method buffers the input internally, so there is no need to use a