From: <mol...@us...> - 2010-12-28 14:33:38
|
Revision: 3196 http://openutils.svn.sourceforge.net/openutils/?rev=3196&view=rev Author: molaschi Date: 2010-12-28 14:33:32 +0000 (Tue, 28 Dec 2010) Log Message: ----------- MEDIA-196 fix count bug Modified Paths: -------------- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/utils/ImageUtils.java Modified: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/utils/ImageUtils.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/utils/ImageUtils.java 2010-12-28 13:13:55 UTC (rev 3195) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/utils/ImageUtils.java 2010-12-28 14:33:32 UTC (rev 3196) @@ -1063,41 +1063,13 @@ * {@inheritDoc} */ @Override - public synchronized int read() throws IOException - { - count++; - return super.read(); - } - - /** - * {@inheritDoc} - */ - @Override - public synchronized void reset() throws IOException - { - count = 0; - super.reset(); - } - - /** - * {@inheritDoc} - */ - @Override - public int read(byte[] b) throws IOException - { - int read = super.read(b); - count += read; - return read; - } - - /** - * {@inheritDoc} - */ - @Override public synchronized int read(byte[] b, int off, int len) throws IOException { int read = super.read(b, off, len); - count += read; + if (read > 0) + { + count += read; + } return read; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |