You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2016/04/06 02:20:47 UTC
svn commit: r1737897 -
/commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/DemuxOutputStream.java
Author: ggregory
Date: Wed Apr 6 00:20:47 2016
New Revision: 1737897
URL: http://svn.apache.org/viewvc?rev=1737897&view=rev
Log:
Fix funky formating.
Modified:
commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/DemuxOutputStream.java
Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/DemuxOutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/DemuxOutputStream.java?rev=1737897&r1=1737896&r2=1737897&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/DemuxOutputStream.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/DemuxOutputStream.java Wed Apr 6 00:20:47 2016
@@ -20,41 +20,36 @@ import java.io.IOException;
import java.io.OutputStream;
/**
- * Data written to this stream is forwarded to a stream that has been associated
- * with this thread.
+ * Data written to this stream is forwarded to a stream that has been associated with this thread.
*
* @version $Id$
*/
-public class DemuxOutputStream
- extends OutputStream
-{
+public class DemuxOutputStream extends OutputStream {
private final InheritableThreadLocal<OutputStream> m_streams = new InheritableThreadLocal<OutputStream>();
/**
* Bind the specified stream to the current thread.
*
- * @param output the stream to bind
+ * @param output
+ * the stream to bind
* @return the OutputStream that was previously active
*/
- public OutputStream bindStream( final OutputStream output )
- {
+ public OutputStream bindStream(final OutputStream output) {
final OutputStream stream = m_streams.get();
- m_streams.set( output );
+ m_streams.set(output);
return stream;
}
/**
* Closes stream associated with current thread.
*
- * @throws IOException if an error occurs
+ * @throws IOException
+ * if an error occurs
*/
@Override
- public void close()
- throws IOException
- {
+ public void close() throws IOException {
final OutputStream output = m_streams.get();
- if( null != output )
- {
+ if (null != output) {
output.close();
}
}
@@ -62,15 +57,13 @@ public class DemuxOutputStream
/**
* Flushes stream associated with current thread.
*
- * @throws IOException if an error occurs
+ * @throws IOException
+ * if an error occurs
*/
@Override
- public void flush()
- throws IOException
- {
+ public void flush() throws IOException {
final OutputStream output = m_streams.get();
- if( null != output )
- {
+ if (null != output) {
output.flush();
}
}
@@ -78,17 +71,16 @@ public class DemuxOutputStream
/**
* Writes byte to stream associated with current thread.
*
- * @param ch the byte to write to stream
- * @throws IOException if an error occurs
+ * @param ch
+ * the byte to write to stream
+ * @throws IOException
+ * if an error occurs
*/
@Override
- public void write( final int ch )
- throws IOException
- {
+ public void write(final int ch) throws IOException {
final OutputStream output = m_streams.get();
- if( null != output )
- {
- output.write( ch );
+ if (null != output) {
+ output.write(ch);
}
}
}