diff options
Diffstat (limited to 'libjava/classpath/javax/imageio')
33 files changed, 763 insertions, 766 deletions
diff --git a/libjava/classpath/javax/imageio/IIOImage.java b/libjava/classpath/javax/imageio/IIOImage.java index bd69bae5f1e..a368e5a840d 100644 --- a/libjava/classpath/javax/imageio/IIOImage.java +++ b/libjava/classpath/javax/imageio/IIOImage.java @@ -96,12 +96,12 @@ public class IIOImage { if (raster == null) throw new IllegalArgumentException ("raster may not be null"); - + this.raster = raster; this.thumbnails = thumbnails; this.metadata = metadata; } - + /** * Construct an IIOImage containing rendered image data, thumbnails * and metadata. @@ -117,7 +117,7 @@ public class IIOImage { if (image == null) throw new IllegalArgumentException ("image may not be null"); - + this.image = image; this.thumbnails = thumbnails; this.metadata = metadata; @@ -232,7 +232,7 @@ public class IIOImage { if (raster == null) throw new IllegalArgumentException ("raster may not be null"); - + this.image = null; this.raster = raster; } diff --git a/libjava/classpath/javax/imageio/IIOParam.java b/libjava/classpath/javax/imageio/IIOParam.java index f6460b4e7ed..3e785474764 100644 --- a/libjava/classpath/javax/imageio/IIOParam.java +++ b/libjava/classpath/javax/imageio/IIOParam.java @@ -158,10 +158,10 @@ public abstract class IIOParam { if (controller == null) { - if (defaultController == null || no_controller) - return false; - else - return defaultController.activate (this); + if (defaultController == null || no_controller) + return false; + else + return defaultController.activate (this); } else return controller.activate(this); @@ -173,7 +173,7 @@ public abstract class IIOParam * set to null. * * @return the currently used controller or null - */ + */ public IIOParamController getController() { return controller == null ? @@ -254,7 +254,7 @@ public abstract class IIOParam { return sourceXSubsampling; } - + /** * Retrieve the number of pixel rows to advance before taking a * pixel sample. @@ -313,13 +313,13 @@ public abstract class IIOParam { if (controller == defaultController) { - this.controller = null; - no_controller = false; + this.controller = null; + no_controller = false; } else { - no_controller = (controller == null); - this.controller = controller; + no_controller = (controller == null); + this.controller = controller; } } @@ -401,24 +401,24 @@ public abstract class IIOParam public void setSourceRegion(Rectangle sourceRegion) { if (sourceRegion != null - && (sourceRegion.x < 0 - || sourceRegion.y < 0 - || sourceRegion.width <= 0 - || sourceRegion.height <= 0)) + && (sourceRegion.x < 0 + || sourceRegion.y < 0 + || sourceRegion.width <= 0 + || sourceRegion.height <= 0)) throw new IllegalArgumentException("illegal source region"); if (sourceRegion != null) { - int num_rows = - (sourceRegion.height - subsamplingYOffset + sourceYSubsampling - 1) - / sourceYSubsampling; + int num_rows = + (sourceRegion.height - subsamplingYOffset + sourceYSubsampling - 1) + / sourceYSubsampling; - int num_columns = - (sourceRegion.width - subsamplingXOffset + sourceXSubsampling - 1) - / sourceXSubsampling; + int num_columns = + (sourceRegion.width - subsamplingXOffset + sourceXSubsampling - 1) + / sourceXSubsampling; - if (num_rows <= 0 || num_columns <= 0) - throw new IllegalStateException("zero pixels in source region"); + if (num_rows <= 0 || num_columns <= 0) + throw new IllegalStateException("zero pixels in source region"); } this.sourceRegion = sourceRegion; @@ -462,25 +462,25 @@ public abstract class IIOParam * zero pixel samples */ public void setSourceSubsampling(int sourceXSubsampling, int sourceYSubsampling, - int subsamplingXOffset, int subsamplingYOffset) + int subsamplingXOffset, int subsamplingYOffset) { if (subsamplingXOffset < 0 || subsamplingYOffset < 0) throw new IllegalArgumentException("subsampling offset < 0"); if (sourceRegion != null) { - int num_rows = - (sourceRegion.height - subsamplingYOffset + sourceYSubsampling - 1) - / sourceYSubsampling; - - int num_columns = - (sourceRegion.width - subsamplingXOffset + sourceXSubsampling - 1) - / sourceXSubsampling; - - if (num_rows <= 0 || num_columns <= 0) - throw new IllegalStateException("subsampling parameters would" - + " produce zero pixel samples" - + " in source region"); + int num_rows = + (sourceRegion.height - subsamplingYOffset + sourceYSubsampling - 1) + / sourceYSubsampling; + + int num_columns = + (sourceRegion.width - subsamplingXOffset + sourceXSubsampling - 1) + / sourceXSubsampling; + + if (num_rows <= 0 || num_columns <= 0) + throw new IllegalStateException("subsampling parameters would" + + " produce zero pixel samples" + + " in source region"); } this.sourceXSubsampling = sourceXSubsampling; diff --git a/libjava/classpath/javax/imageio/IIOParamController.java b/libjava/classpath/javax/imageio/IIOParamController.java index 0ee54df4071..e77f8542f6f 100644 --- a/libjava/classpath/javax/imageio/IIOParamController.java +++ b/libjava/classpath/javax/imageio/IIOParamController.java @@ -61,7 +61,7 @@ public interface IIOParamController * * @return true if the <code>IIOParam</code> has been modified, * false otherwise - * + * * @exception IllegalArgumentException if param is null or is not an instance * of the correct class */ diff --git a/libjava/classpath/javax/imageio/ImageIO.java b/libjava/classpath/javax/imageio/ImageIO.java index 5f0d71d60a9..9abb1c81890 100644 --- a/libjava/classpath/javax/imageio/ImageIO.java +++ b/libjava/classpath/javax/imageio/ImageIO.java @@ -125,7 +125,7 @@ public final class ImageIO return false; } } - + private static final class ReaderObjectFilter implements ServiceRegistry.Filter { private Object object; @@ -179,7 +179,7 @@ public final class ImageIO return false; } } - + private static final class WriterFormatFilter implements ServiceRegistry.Filter { private String formatName; @@ -192,14 +192,14 @@ public final class ImageIO public boolean filter(Object provider) { if (provider instanceof ImageWriterSpi) - { - ImageWriterSpi spi = (ImageWriterSpi) provider; - String[] formatNames = spi.getFormatNames(); - - for (int i = formatNames.length - 1; i >= 0; --i) + { + ImageWriterSpi spi = (ImageWriterSpi) provider; + String[] formatNames = spi.getFormatNames(); + + for (int i = formatNames.length - 1; i >= 0; --i) if (formatName.equals(formatNames[i])) return true; - } + } return false; } @@ -229,7 +229,7 @@ public final class ImageIO return false; } } - + private static final class WriterSuffixFilter implements ServiceRegistry.Filter { private String fileSuffix; @@ -261,7 +261,7 @@ public final class ImageIO private String formatName; public WriterObjectFilter(ImageTypeSpecifier type, - String formatName) + String formatName) { this.type = type; this.formatName = formatName; @@ -273,13 +273,13 @@ public final class ImageIO { ImageWriterSpi spi = (ImageWriterSpi) provider; - if (spi.canEncodeImage(type)) - { - String[] formatNames = spi.getFormatNames(); - for (int i = formatNames.length - 1; i >= 0; --i) - if (formatName.equals(formatNames[i])) - return true; - } + if (spi.canEncodeImage(type)) + { + String[] formatNames = spi.getFormatNames(); + for (int i = formatNames.length - 1; i >= 0; --i) + if (formatName.equals(formatNames[i])) + return true; + } } return false; @@ -304,11 +304,11 @@ public final class ImageIO { ImageTranscoderSpi spi = (ImageTranscoderSpi) provider; - if (spi.getReaderServiceProviderName().equals - (reader.getOriginatingProvider().getClass().getName()) - && spi.getWriterServiceProviderName().equals - (writer.getOriginatingProvider().getClass().getName())) - return true; + if (spi.getReaderServiceProviderName().equals + (reader.getOriginatingProvider().getClass().getName()) + && spi.getWriterServiceProviderName().equals + (writer.getOriginatingProvider().getClass().getName())) + return true; } return false; @@ -320,14 +320,14 @@ public final class ImageIO { Iterator<ImageReaderSpi> it; Object readerExtension; - + public ImageReaderIterator(Iterator<ImageReaderSpi> it, Object readerExtension) { this.it = it; this.readerExtension = readerExtension; } - + public ImageReaderIterator(Iterator<ImageReaderSpi> it) { this.it = it; @@ -364,14 +364,14 @@ public final class ImageIO { Iterator<ImageWriterSpi> it; Object writerExtension; - + public ImageWriterIterator(Iterator<ImageWriterSpi> it, Object writerExtension) { this.it = it; this.writerExtension = writerExtension; } - + public ImageWriterIterator(Iterator<ImageWriterSpi> it) { this.it = it; @@ -402,7 +402,7 @@ public final class ImageIO throw new UnsupportedOperationException(); } } - + private static File cacheDirectory; private static boolean useCache = true; @@ -421,7 +421,7 @@ public final class ImageIO return Collections.EMPTY_SET.iterator(); } } - + private static Iterator<ImageWriter> getWritersByFilter(Class<ImageWriterSpi> type, ServiceRegistry.Filter filter, Object writerExtension) @@ -503,7 +503,7 @@ public final class ImageIO { if (fileSuffix == null) throw new IllegalArgumentException("formatName may not be null"); - + return getReadersByFilter(ImageReaderSpi.class, new ReaderSuffixFilter(fileSuffix), fileSuffix); @@ -523,7 +523,7 @@ public final class ImageIO { if (formatName == null) throw new IllegalArgumentException("formatName may not be null"); - + return getWritersByFilter(ImageWriterSpi.class, new WriterFormatFilter(formatName), formatName); @@ -544,7 +544,7 @@ public final class ImageIO { if (MIMEType == null) throw new IllegalArgumentException("MIMEType may not be null"); - + return getWritersByFilter(ImageWriterSpi.class, new WriterMIMETypeFilter(MIMEType), MIMEType); @@ -564,7 +564,7 @@ public final class ImageIO { if (fileSuffix == null) throw new IllegalArgumentException("fileSuffix may not be null"); - + return getWritersByFilter(ImageWriterSpi.class, new WriterSuffixFilter(fileSuffix), fileSuffix); @@ -581,19 +581,19 @@ public final class ImageIO try { Iterator it = - getRegistry().getServiceProviders(ImageReaderSpi.class, true); - ArrayList result = new ArrayList(); + getRegistry().getServiceProviders(ImageReaderSpi.class, true); + ArrayList result = new ArrayList(); - while (it.hasNext()) - { - ImageReaderSpi spi = (ImageReaderSpi) it.next(); - String[] names = spi.getFormatNames(); + while (it.hasNext()) + { + ImageReaderSpi spi = (ImageReaderSpi) it.next(); + String[] names = spi.getFormatNames(); - for (int i = names.length - 1; i >= 0; --i) - result.add(names[i]); - } + for (int i = names.length - 1; i >= 0; --i) + result.add(names[i]); + } - return (String[]) result.toArray(new String[result.size()]); + return (String[]) result.toArray(new String[result.size()]); } catch (IllegalArgumentException e) { @@ -612,19 +612,19 @@ public final class ImageIO try { Iterator it = - getRegistry().getServiceProviders(ImageReaderSpi.class, true); - ArrayList result = new ArrayList(); + getRegistry().getServiceProviders(ImageReaderSpi.class, true); + ArrayList result = new ArrayList(); - while (it.hasNext()) - { - ImageReaderSpi spi = (ImageReaderSpi) it.next(); - String[] names = spi.getMIMETypes(); + while (it.hasNext()) + { + ImageReaderSpi spi = (ImageReaderSpi) it.next(); + String[] names = spi.getMIMETypes(); - for (int i = names.length - 1; i >= 0; --i) - result.add(names[i]); - } + for (int i = names.length - 1; i >= 0; --i) + result.add(names[i]); + } - return (String[]) result.toArray(new String[result.size()]); + return (String[]) result.toArray(new String[result.size()]); } catch (IllegalArgumentException e) { @@ -659,19 +659,19 @@ public final class ImageIO try { Iterator it = - getRegistry().getServiceProviders(ImageWriterSpi.class, true); - ArrayList result = new ArrayList(); + getRegistry().getServiceProviders(ImageWriterSpi.class, true); + ArrayList result = new ArrayList(); - while (it.hasNext()) - { - ImageWriterSpi spi = (ImageWriterSpi) it.next(); - String[] names = spi.getFormatNames(); + while (it.hasNext()) + { + ImageWriterSpi spi = (ImageWriterSpi) it.next(); + String[] names = spi.getFormatNames(); - for (int i = names.length - 1; i >= 0; --i) - result.add(names[i]); - } + for (int i = names.length - 1; i >= 0; --i) + result.add(names[i]); + } - return (String[]) result.toArray(new String[result.size()]); + return (String[]) result.toArray(new String[result.size()]); } catch (IllegalArgumentException e) { @@ -690,26 +690,26 @@ public final class ImageIO try { Iterator it = - getRegistry().getServiceProviders(ImageWriterSpi.class, true); - ArrayList result = new ArrayList(); + getRegistry().getServiceProviders(ImageWriterSpi.class, true); + ArrayList result = new ArrayList(); - while (it.hasNext()) - { - ImageWriterSpi spi = (ImageWriterSpi) it.next(); - String[] names = spi.getMIMETypes(); + while (it.hasNext()) + { + ImageWriterSpi spi = (ImageWriterSpi) it.next(); + String[] names = spi.getMIMETypes(); - for (int i = names.length - 1; i >= 0; --i) - result.add(names[i]); - } + for (int i = names.length - 1; i >= 0; --i) + result.add(names[i]); + } - return (String[]) result.toArray(new String[result.size()]); + return (String[]) result.toArray(new String[result.size()]); } catch (IllegalArgumentException e) { return new String[0]; } } - + /** * Rescans the application classpath for ImageIO service providers * and registers them. @@ -740,7 +740,7 @@ public final class ImageIO cacheDirectory.canWrite(); } - + ImageIO.cacheDirectory = cacheDirectory; } @@ -841,7 +841,7 @@ public final class ImageIO while (writers.hasNext()) { ImageWriter w = (ImageWriter) writers.next(); - try + try { w.setOutput(output); } @@ -849,7 +849,7 @@ public final class ImageIO { continue; } - + w.write(null, img, null); w.dispose(); output.close(); @@ -1014,13 +1014,13 @@ public final class ImageIO while(spis.hasNext()) { - ImageInputStreamSpi spi = (ImageInputStreamSpi) spis.next(); + ImageInputStreamSpi spi = (ImageInputStreamSpi) spis.next(); - if (input.getClass().equals(spi.getInputClass())) - { - foundSpi = spi; - break; - } + if (input.getClass().equals(spi.getInputClass())) + { + foundSpi = spi; + break; + } } return foundSpi == null ? null : @@ -1060,13 +1060,13 @@ public final class ImageIO while(spis.hasNext()) { - ImageOutputStreamSpi spi = (ImageOutputStreamSpi) spis.next(); + ImageOutputStreamSpi spi = (ImageOutputStreamSpi) spis.next(); - if (output.getClass().equals(spi.getOutputClass())) - { - foundSpi = spi; - break; - } + if (output.getClass().equals(spi.getOutputClass())) + { + foundSpi = spi; + break; + } } return foundSpi == null ? null : @@ -1143,7 +1143,7 @@ public final class ImageIO * @return an iterator over a collection of image writers */ public static Iterator<ImageWriter> getImageWriters (ImageTypeSpecifier type, - String formatName) + String formatName) { if (type == null || formatName == null) throw new IllegalArgumentException ("null argument"); @@ -1226,12 +1226,12 @@ public final class ImageIO { return spiIterator.hasNext(); } - + public ImageTranscoder next() { return spiIterator.next().createTranscoderInstance(); } - + public void remove() { throw new UnsupportedOperationException(); diff --git a/libjava/classpath/javax/imageio/ImageReadParam.java b/libjava/classpath/javax/imageio/ImageReadParam.java index b2680f6b14e..8a31253e8d4 100644 --- a/libjava/classpath/javax/imageio/ImageReadParam.java +++ b/libjava/classpath/javax/imageio/ImageReadParam.java @@ -112,17 +112,17 @@ public class ImageReadParam extends IIOParam this.minProgressivePass = minPass; this.numProgressivePasses = numPasses; } - + public void setSourceRenderSize(Dimension size) throws UnsupportedOperationException { if (! canSetSourceRenderSize()) throw new UnsupportedOperationException - ("setting source render size not supported"); - + ("setting source render size not supported"); + if (size.width <= 0 || size.height <= 0) throw new IllegalArgumentException("negative dimension not allowed"); - + sourceRenderSize = size; } } diff --git a/libjava/classpath/javax/imageio/ImageReader.java b/libjava/classpath/javax/imageio/ImageReader.java index 269493f2330..14e935994cb 100644 --- a/libjava/classpath/javax/imageio/ImageReader.java +++ b/libjava/classpath/javax/imageio/ImageReader.java @@ -290,7 +290,7 @@ public abstract class ImageReader { if (availableLocales == null) return null; - + return (Locale[]) availableLocales.clone(); } @@ -770,14 +770,14 @@ public abstract class ImageReader { if (progressListeners != null) { - Iterator it = progressListeners.iterator(); - - while (it.hasNext()) - { - IIOReadProgressListener listener = - (IIOReadProgressListener) it.next(); - listener.imageComplete (this); - } + Iterator it = progressListeners.iterator(); + + while (it.hasNext()) + { + IIOReadProgressListener listener = + (IIOReadProgressListener) it.next(); + listener.imageComplete (this); + } } } @@ -793,14 +793,14 @@ public abstract class ImageReader { if (progressListeners != null) { - Iterator it = progressListeners.iterator(); - - while (it.hasNext()) - { - IIOReadProgressListener listener = - (IIOReadProgressListener) it.next(); - listener.imageProgress(this, percentageDone); - } + Iterator it = progressListeners.iterator(); + + while (it.hasNext()) + { + IIOReadProgressListener listener = + (IIOReadProgressListener) it.next(); + listener.imageProgress(this, percentageDone); + } } } /** @@ -815,14 +815,14 @@ public abstract class ImageReader { if (progressListeners != null) { - Iterator it = progressListeners.iterator(); - - while (it.hasNext()) - { - IIOReadProgressListener listener = - (IIOReadProgressListener) it.next(); - listener.imageStarted(this, imageIndex); - } + Iterator it = progressListeners.iterator(); + + while (it.hasNext()) + { + IIOReadProgressListener listener = + (IIOReadProgressListener) it.next(); + listener.imageStarted(this, imageIndex); + } } } @@ -842,19 +842,19 @@ public abstract class ImageReader * @param bands the affected bands in the destination */ protected void processImageUpdate(BufferedImage image, int minX, int minY, - int width, int height, int periodX, - int periodY, int[] bands) + int width, int height, int periodX, + int periodY, int[] bands) { if (updateListeners != null) { - Iterator it = updateListeners.iterator(); - - while (it.hasNext()) - { - IIOReadUpdateListener listener = (IIOReadUpdateListener) it.next(); - listener.imageUpdate(this, image, minX, minY, width, height, - periodX, periodY, bands); - } + Iterator it = updateListeners.iterator(); + + while (it.hasNext()) + { + IIOReadUpdateListener listener = (IIOReadUpdateListener) it.next(); + listener.imageUpdate(this, image, minX, minY, width, height, + periodX, periodY, bands); + } } } @@ -869,13 +869,13 @@ public abstract class ImageReader { if (updateListeners != null) { - Iterator it = updateListeners.iterator(); + Iterator it = updateListeners.iterator(); - while (it.hasNext()) - { - IIOReadUpdateListener listener = (IIOReadUpdateListener) it.next(); - listener.passComplete(this, image); - } + while (it.hasNext()) + { + IIOReadUpdateListener listener = (IIOReadUpdateListener) it.next(); + listener.passComplete(this, image); + } } } @@ -898,19 +898,19 @@ public abstract class ImageReader * @param bands the affected bands in the destination */ protected void processPassStarted(BufferedImage image, int pass, int minPass, - int maxPass, int minX, int minY, - int periodX, int periodY, int[] bands) + int maxPass, int minX, int minY, + int periodX, int periodY, int[] bands) { if (updateListeners != null) { - Iterator it = updateListeners.iterator(); - - while (it.hasNext()) - { - IIOReadUpdateListener listener = (IIOReadUpdateListener) it.next(); - listener.passStarted(this, image, pass, minPass, maxPass, minX, - minY, periodX, periodY, bands); - } + Iterator it = updateListeners.iterator(); + + while (it.hasNext()) + { + IIOReadUpdateListener listener = (IIOReadUpdateListener) it.next(); + listener.passStarted(this, image, pass, minPass, maxPass, minX, + minY, periodX, periodY, bands); + } } } @@ -922,14 +922,14 @@ public abstract class ImageReader { if (progressListeners != null) { - Iterator it = progressListeners.iterator(); - - while (it.hasNext()) - { - IIOReadProgressListener listener = - (IIOReadProgressListener) it.next(); - listener.readAborted(this); - } + Iterator it = progressListeners.iterator(); + + while (it.hasNext()) + { + IIOReadProgressListener listener = + (IIOReadProgressListener) it.next(); + listener.readAborted(this); + } } } /** @@ -941,14 +941,14 @@ public abstract class ImageReader { if (progressListeners != null) { - Iterator it = progressListeners.iterator(); - - while (it.hasNext()) - { - IIOReadProgressListener listener = - (IIOReadProgressListener) it.next(); - listener.sequenceComplete(this); - } + Iterator it = progressListeners.iterator(); + + while (it.hasNext()) + { + IIOReadProgressListener listener = + (IIOReadProgressListener) it.next(); + listener.sequenceComplete(this); + } } } @@ -964,14 +964,14 @@ public abstract class ImageReader if (progressListeners != null) { - Iterator it = progressListeners.iterator(); - - while (it.hasNext()) - { - IIOReadProgressListener listener = - (IIOReadProgressListener) it.next(); - listener.sequenceStarted(this, minIndex); - } + Iterator it = progressListeners.iterator(); + + while (it.hasNext()) + { + IIOReadProgressListener listener = + (IIOReadProgressListener) it.next(); + listener.sequenceStarted(this, minIndex); + } } } @@ -984,14 +984,14 @@ public abstract class ImageReader { if (progressListeners != null) { - Iterator it = progressListeners.iterator(); - - while (it.hasNext()) - { - IIOReadProgressListener listener = - (IIOReadProgressListener) it.next(); - listener.thumbnailComplete(this); - } + Iterator it = progressListeners.iterator(); + + while (it.hasNext()) + { + IIOReadProgressListener listener = + (IIOReadProgressListener) it.next(); + listener.thumbnailComplete(this); + } } } @@ -1006,13 +1006,13 @@ public abstract class ImageReader { if (updateListeners != null) { - Iterator it = updateListeners.iterator(); + Iterator it = updateListeners.iterator(); - while (it.hasNext()) - { - IIOReadUpdateListener listener = (IIOReadUpdateListener) it.next(); - listener.thumbnailPassComplete(this, thumbnail); - } + while (it.hasNext()) + { + IIOReadUpdateListener listener = (IIOReadUpdateListener) it.next(); + listener.thumbnailPassComplete(this, thumbnail); + } } } @@ -1035,21 +1035,21 @@ public abstract class ImageReader * @param bands the affected bands in the destination */ protected void processThumbnailPassStarted(BufferedImage thumbnail, int pass, - int minPass, int maxPass, int minX, - int minY, int periodX, int periodY, - int[] bands) + int minPass, int maxPass, int minX, + int minY, int periodX, int periodY, + int[] bands) { if (updateListeners != null) { - Iterator it = updateListeners.iterator(); - - while (it.hasNext()) - { - IIOReadUpdateListener listener = (IIOReadUpdateListener) it.next(); - listener.thumbnailPassStarted(this, thumbnail, pass, minPass, - maxPass, minX, minY, periodX, - periodY, bands); - } + Iterator it = updateListeners.iterator(); + + while (it.hasNext()) + { + IIOReadUpdateListener listener = (IIOReadUpdateListener) it.next(); + listener.thumbnailPassStarted(this, thumbnail, pass, minPass, + maxPass, minX, minY, periodX, + periodY, bands); + } } } @@ -1065,14 +1065,14 @@ public abstract class ImageReader { if (progressListeners != null) { - Iterator it = progressListeners.iterator(); - - while (it.hasNext()) - { - IIOReadProgressListener listener = - (IIOReadProgressListener) it.next(); - listener.thumbnailProgress(this, percentageDone); - } + Iterator it = progressListeners.iterator(); + + while (it.hasNext()) + { + IIOReadProgressListener listener = + (IIOReadProgressListener) it.next(); + listener.thumbnailProgress(this, percentageDone); + } } } @@ -1090,14 +1090,14 @@ public abstract class ImageReader { if (progressListeners != null) { - Iterator it = progressListeners.iterator(); - - while (it.hasNext()) - { - IIOReadProgressListener listener = - (IIOReadProgressListener) it.next(); - listener.thumbnailStarted(this, imageIndex, thumbnailIndex); - } + Iterator it = progressListeners.iterator(); + + while (it.hasNext()) + { + IIOReadProgressListener listener = + (IIOReadProgressListener) it.next(); + listener.thumbnailStarted(this, imageIndex, thumbnailIndex); + } } } @@ -1117,19 +1117,19 @@ public abstract class ImageReader * @param bands the affected bands in the destination */ protected void processThumbnailUpdate(BufferedImage image, int minX, int minY, - int width, int height, int periodX, - int periodY, int[] bands) + int width, int height, int periodX, + int periodY, int[] bands) { if (updateListeners != null) { - Iterator it = updateListeners.iterator(); - - while (it.hasNext()) - { - IIOReadUpdateListener listener = (IIOReadUpdateListener) it.next(); - listener.thumbnailUpdate(this, image, minX, minY, width, height, - periodX, periodY, bands); - } + Iterator it = updateListeners.iterator(); + + while (it.hasNext()) + { + IIOReadUpdateListener listener = (IIOReadUpdateListener) it.next(); + listener.thumbnailUpdate(this, image, minX, minY, width, height, + periodX, periodY, bands); + } } } @@ -1147,14 +1147,14 @@ public abstract class ImageReader throw new IllegalArgumentException ("null argument"); if (warningListeners != null) { - Iterator it = warningListeners.iterator(); - - while (it.hasNext()) - { - IIOReadWarningListener listener = - (IIOReadWarningListener) it.next(); - listener.warningOccurred(this, warning); - } + Iterator it = warningListeners.iterator(); + + while (it.hasNext()) + { + IIOReadWarningListener listener = + (IIOReadWarningListener) it.next(); + listener.warningOccurred(this, warning); + } } } @@ -1179,7 +1179,7 @@ public abstract class ImageReader * not a String */ protected void processWarningOccurred(String baseName, - String keyword) + String keyword) { if (baseName == null || keyword == null) throw new IllegalArgumentException ("null argument"); @@ -1188,22 +1188,22 @@ public abstract class ImageReader try { - b = ResourceBundle.getBundle(baseName, getLocale()); + b = ResourceBundle.getBundle(baseName, getLocale()); } catch (MissingResourceException e) { - throw new IllegalArgumentException ("no resource bundle found"); + throw new IllegalArgumentException ("no resource bundle found"); } Object str = null; try { - str = b.getObject(keyword); + str = b.getObject(keyword); } catch (MissingResourceException e) { - throw new IllegalArgumentException ("no results found for keyword"); + throw new IllegalArgumentException ("no results found for keyword"); } if (! (str instanceof String)) @@ -1213,14 +1213,14 @@ public abstract class ImageReader if (warningListeners != null) { - Iterator it = warningListeners.iterator(); - - while (it.hasNext()) - { - IIOReadWarningListener listener = - (IIOReadWarningListener) it.next(); - listener.warningOccurred(this, warning); - } + Iterator it = warningListeners.iterator(); + + while (it.hasNext()) + { + IIOReadWarningListener listener = + (IIOReadWarningListener) it.next(); + listener.warningOccurred(this, warning); + } } } @@ -1292,7 +1292,7 @@ public abstract class ImageReader * @exception IndexOutOfBoundsException if either the frame index or * the thumbnail index is out-of-bounds * @exception IOException if a read error occurs - * + * */ public BufferedImage readThumbnail(int imageIndex, int thumbnailIndex) throws IOException @@ -1329,13 +1329,13 @@ public abstract class ImageReader * * @param listener the listener to remove */ - public void removeIIOReadProgressListener(IIOReadProgressListener listener) + public void removeIIOReadProgressListener(IIOReadProgressListener listener) { if (listener == null) return; if (progressListeners != null) { - progressListeners.remove(listener); + progressListeners.remove(listener); } } @@ -1344,14 +1344,14 @@ public abstract class ImageReader * * @param listener the listener to remove */ - public void removeIIOReadUpdateListener(IIOReadUpdateListener listener) + public void removeIIOReadUpdateListener(IIOReadUpdateListener listener) { if (listener == null) return; if (updateListeners != null) { - updateListeners.remove(listener); + updateListeners.remove(listener); } } @@ -1366,7 +1366,7 @@ public abstract class ImageReader return; if (warningListeners != null) { - warningListeners.remove(listener); + warningListeners.remove(listener); } } @@ -1379,16 +1379,16 @@ public abstract class ImageReader { if (locale != null) { - // Check if its a valid locale. - boolean found = false; + // Check if its a valid locale. + boolean found = false; - if (availableLocales != null) - for (int i = availableLocales.length - 1; i >= 0; --i) - if (availableLocales[i].equals(locale)) - found = true; + if (availableLocales != null) + for (int i = availableLocales.length - 1; i >= 0; --i) + if (availableLocales[i].equals(locale)) + found = true; - if (! found) - throw new IllegalArgumentException("looale not available"); + if (! found) + throw new IllegalArgumentException("looale not available"); } this.locale = locale; @@ -1411,8 +1411,8 @@ public abstract class ImageReader * destination band indices are invalid */ protected static void checkReadParamBandSettings(ImageReadParam param, - int numSrcBands, - int numDstBands) + int numSrcBands, + int numDstBands) { int[] srcBands = param.getSourceBands(); int[] dstBands = param.getDestinationBands(); @@ -1513,11 +1513,11 @@ public abstract class ImageReader * regions is empty */ protected static void computeRegions (ImageReadParam param, - int srcWidth, - int srcHeight, - BufferedImage image, - Rectangle srcRegion, - Rectangle destRegion) + int srcWidth, + int srcHeight, + BufferedImage image, + Rectangle srcRegion, + Rectangle destRegion) { if (srcRegion == null || destRegion == null) throw new IllegalArgumentException ("null region"); @@ -1594,9 +1594,9 @@ public abstract class ImageReader * height is greater than Integer.MAX_VALUE */ protected static BufferedImage getDestination (ImageReadParam param, - Iterator<ImageTypeSpecifier> imageTypes, - int width, - int height) + Iterator<ImageTypeSpecifier> imageTypes, + int width, + int height) throws IIOException { if (imageTypes == null || !imageTypes.hasNext()) @@ -1751,8 +1751,8 @@ public abstract class ImageReader * @return a clipped rectangle */ protected static Rectangle getSourceRegion (ImageReadParam param, - int srcWidth, - int srcHeight) + int srcWidth, + int srcHeight) { Rectangle clippedRegion = new Rectangle (0, 0, srcWidth, srcHeight); @@ -1870,7 +1870,7 @@ public abstract class ImageReader * @exception IOException if a read error occurs */ public IIOImage readAll (int imageIndex, - ImageReadParam param) + ImageReadParam param) throws IOException { checkReadParamBandSettings (param, @@ -1953,7 +1953,7 @@ public abstract class ImageReader * @exception IOException if a read error occurs */ public RenderedImage readAsRenderedImage (int imageIndex, - ImageReadParam param) + ImageReadParam param) throws IOException { return read (imageIndex, param); @@ -2033,4 +2033,3 @@ public abstract class ImageReader clearAbortRequest (); } } - diff --git a/libjava/classpath/javax/imageio/ImageTranscoder.java b/libjava/classpath/javax/imageio/ImageTranscoder.java index 1f9195f5816..352bb18b763 100644 --- a/libjava/classpath/javax/imageio/ImageTranscoder.java +++ b/libjava/classpath/javax/imageio/ImageTranscoder.java @@ -78,8 +78,8 @@ public interface ImageTranscoder * is null */ IIOMetadata convertImageMetadata(IIOMetadata inData, - ImageTypeSpecifier imageType, - ImageWriteParam param); + ImageTypeSpecifier imageType, + ImageWriteParam param); /** * Converts IIOMetadata from an input stream format, returning an @@ -98,5 +98,5 @@ public interface ImageTranscoder * @exception IllegalArgumentException if inData is null */ IIOMetadata convertStreamMetadata(IIOMetadata inData, - ImageWriteParam param); + ImageWriteParam param); } diff --git a/libjava/classpath/javax/imageio/ImageTypeSpecifier.java b/libjava/classpath/javax/imageio/ImageTypeSpecifier.java index 3faa3c937c3..da229610aee 100644 --- a/libjava/classpath/javax/imageio/ImageTypeSpecifier.java +++ b/libjava/classpath/javax/imageio/ImageTypeSpecifier.java @@ -90,7 +90,7 @@ public class ImageTypeSpecifier if (!colorModel.isCompatibleSampleModel(sampleModel)) throw new IllegalArgumentException ("sample Model not compatible with colorModel"); - + this.colorModel = colorModel; this.sampleModel = sampleModel; } @@ -107,7 +107,7 @@ public class ImageTypeSpecifier { if (image == null) throw new IllegalArgumentException("image may not be null"); - + this.colorModel = image.getColorModel(); this.sampleModel = image.getSampleModel(); } @@ -324,11 +324,11 @@ public class ImageTypeSpecifier * data type */ public static ImageTypeSpecifier createIndexed (byte[] redLUT, - byte[] greenLUT, - byte[] blueLUT, - byte[] alphaLUT, - int bits, - int dataType) + byte[] greenLUT, + byte[] blueLUT, + byte[] alphaLUT, + int bits, + int dataType) { if (redLUT == null || greenLUT == null || blueLUT == null) throw new IllegalArgumentException ("null colour table"); @@ -402,10 +402,10 @@ public class ImageTypeSpecifier * one value of the given data type. * * @param colorSpace the color space to use in the color model - * @param redMask the bitmask for the red bits - * @param greenMask the bitmask for the green bits - * @param blueMask the bitmask for the blue bits - * @param alphaMask the bitmask for the alpha bits + * @param redMask the bitmask for the red bits + * @param greenMask the bitmask for the green bits + * @param blueMask the bitmask for the blue bits + * @param alphaMask the bitmask for the alpha bits * @param transferType the data type used to store pixel values * @param isAlphaPremultiplied true if other colour channels should * be premultiplied by the alpha value, false otherwise diff --git a/libjava/classpath/javax/imageio/ImageWriteParam.java b/libjava/classpath/javax/imageio/ImageWriteParam.java index f4794a37530..1c400e1ea36 100644 --- a/libjava/classpath/javax/imageio/ImageWriteParam.java +++ b/libjava/classpath/javax/imageio/ImageWriteParam.java @@ -46,118 +46,118 @@ import java.util.Locale; */ public class ImageWriteParam extends IIOParam { - - /** + + /** * Can be passed to setTilingMode, setProgressiveMode and * setCompressionMode to disable feature. */ public static final int MODE_DISABLED = 0; - - /** - * Can be passed to setTilingMode, setProgressiveMode and + + /** + * Can be passed to setTilingMode, setProgressiveMode and * setCompressionMode to enable feature. */ public static final int MODE_DEFAULT = 1; - - /** + + /** * Can be passed to setTilingMode, setCompressionMode to disable feature. */ public static final int MODE_EXPLICIT = 2; - - /** - * Can be passed to setTilingMode, setProgressiveMode and + + /** + * Can be passed to setTilingMode, setProgressiveMode and * setCompressionMode to enable feature. */ public static final int MODE_COPY_FROM_METADATA = 3; - + /** * True if tiling grid offset parameters can be set. */ protected boolean canOffsetTiles; - + /** * True if this writer can write images using compression. */ protected boolean canWriteCompressed; - + /** * True if images can be written as a progressive sequence * of increasing quality. */ protected boolean canWriteProgressive; - + /** * True if tile width and height parameters can be set. */ protected boolean canWriteTiles; - + /** * Controls compression settings, which must be set to one of the four * MODE_* values. */ protected int compressionMode = MODE_COPY_FROM_METADATA; - + /** * Contains the current compression quality setting. */ protected float compressionQuality; - + /** * Contains the name of the current compression type. */ protected String compressionType; - + /** * Array of the names of the available compression types. */ protected String[] compressionTypes; - + /** * Localizes compression type names and quality descriptions, * or null to use default Locale. */ protected Locale locale; - + /** * Preferred tile size range pairs. */ protected Dimension[] preferredTileSizes; - + /** * The mode controlling progressive encoding, which must * be set to one of the four MODE_* values, except * MODE_EXPLICIT. */ protected int progressiveMode = MODE_COPY_FROM_METADATA; - + /** * The amount by which the tile grid origin should be offset * horizontally from the image origin if tiling has been set. */ protected int tileGridXOffset; - + /** * The amount by which the tile grid origin should be offset * vertically from the image origin if tiling has been set. */ protected int tileGridYOffset; - + /** * The height of each tile if tiling has been set. */ protected int tileHeight; - + /** * The width of each tile if tiling has been set. */ protected int tileWidth; - + /** * The mode controlling tiling settings, which must be * set to one of the four MODE_* values. */ protected int tilingMode; - + /** * True if the tiling parameters have been specified. */ @@ -201,11 +201,11 @@ public class ImageWriteParam extends IIOParam if (getCompressionMode() != MODE_EXPLICIT) throw new IllegalStateException("compression mode is not MODE_EXPLICIT"); } - + private void checkCompressionTypesSet() { if (getCompressionType() == null - && getCompressionTypes() != null) + && getCompressionTypes() != null) throw new IllegalStateException("no compression type set"); } @@ -213,9 +213,9 @@ public class ImageWriteParam extends IIOParam { if (! canWriteProgressive()) throw new UnsupportedOperationException - ("progressive output not supported"); + ("progressive output not supported"); } - + private void checkSupportsTiling() { if (! canWriteTiles()) @@ -279,7 +279,7 @@ public class ImageWriteParam extends IIOParam { checkNotExplicitCompression(); checkCompressionTypesSet(); - + return null; } @@ -287,7 +287,7 @@ public class ImageWriteParam extends IIOParam { checkNotExplicitCompression(); checkCompressionTypesSet(); - + return null; } @@ -383,9 +383,9 @@ public class ImageWriteParam extends IIOParam { checkSupportsCompression(); checkMode(mode); - + compressionMode = mode; - + if (mode == MODE_EXPLICIT) unsetCompression(); } @@ -409,17 +409,17 @@ public class ImageWriteParam extends IIOParam if (types == null) throw new UnsupportedOperationException("no settable compression types"); - + if (compressionType == null) this.compressionType = null; for (int i = types.length - 1; i >= 0; --i) if (types[i].equals(compressionType)) - { - this.compressionType = compressionType; - return; - } - + { + this.compressionType = compressionType; + return; + } + throw new IllegalArgumentException("unknown compression type"); } @@ -427,18 +427,18 @@ public class ImageWriteParam extends IIOParam { checkSupportsProgressiveEncoding(); checkMode(mode); - + progressiveMode = mode; } public void setTiling(int tileWidth, int tileHeight, - int tileGridXOffset, int tileGridYOffset) + int tileGridXOffset, int tileGridYOffset) { checkNotExplicitTiling(); if (! canOffsetTiles - && tileGridXOffset != 0 - && tileGridYOffset != 0) + && tileGridXOffset != 0 + && tileGridYOffset != 0) throw new UnsupportedOperationException("tile offsets not supported"); if (tileWidth < 0 || tileHeight < 0) @@ -446,18 +446,18 @@ public class ImageWriteParam extends IIOParam if (preferredTileSizes != null) { - boolean found = false; - - for (int i = 0; i < preferredTileSizes.length; i += 2) - { - if (tileWidth >= preferredTileSizes[i].width - && tileWidth <= preferredTileSizes[i + 1].width - && tileHeight >= preferredTileSizes[i].height - && tileHeight <= preferredTileSizes[i + 1].height) - found = true; - } - - if (! found) + boolean found = false; + + for (int i = 0; i < preferredTileSizes.length; i += 2) + { + if (tileWidth >= preferredTileSizes[i].width + && tileWidth <= preferredTileSizes[i + 1].width + && tileHeight >= preferredTileSizes[i].height + && tileHeight <= preferredTileSizes[i + 1].height) + found = true; + } + + if (! found) throw new IllegalArgumentException("illegal tile size"); } @@ -478,7 +478,7 @@ public class ImageWriteParam extends IIOParam public void unsetCompression() { checkNotExplicitCompression(); - + compressionType = null; compressionQuality = 1.0F; } @@ -486,7 +486,7 @@ public class ImageWriteParam extends IIOParam public void unsetTiling() { checkNotExplicitTiling(); - + tileWidth = 0; tileHeight = 0; tileGridXOffset = 0; diff --git a/libjava/classpath/javax/imageio/ImageWriter.java b/libjava/classpath/javax/imageio/ImageWriter.java index 78d792c72d4..7a7f45e6f0d 100644 --- a/libjava/classpath/javax/imageio/ImageWriter.java +++ b/libjava/classpath/javax/imageio/ImageWriter.java @@ -76,7 +76,7 @@ public abstract class ImageWriter implements ImageTranscoder { private boolean aborted; - + /** * All locales available for localization of warning messages, or * null if localization is not supported. @@ -138,7 +138,7 @@ public abstract class ImageWriter if (output == null) throw new IllegalStateException("no output set"); } - + /** * Request that writing be aborted. The unwritten portions of the * destination image will be undefined. @@ -392,8 +392,8 @@ public abstract class ImageWriter * is null */ public abstract IIOMetadata convertImageMetadata (IIOMetadata inData, - ImageTypeSpecifier imageType, - ImageWriteParam param); + ImageTypeSpecifier imageType, + ImageWriteParam param); /** * Convert IIOMetadata from an input stream format, returning an @@ -412,7 +412,7 @@ public abstract class ImageWriter * @exception IllegalArgumentException if inData is null */ public abstract IIOMetadata convertStreamMetadata (IIOMetadata inData, - ImageWriteParam param); + ImageWriteParam param); /** * Releases any resources allocated to this object. Subsequent @@ -425,7 +425,7 @@ public abstract class ImageWriter { // The default implementation is empty. Subclasses have to overwrite it. } - + /** * Retrieve the available locales. Return null if no locales are * available or a clone of availableLocales. @@ -504,7 +504,7 @@ public abstract class ImageWriter */ public int getNumThumbnailsSupported (ImageTypeSpecifier imageType, ImageWriteParam param, - IIOMetadata streamMetadata, + IIOMetadata streamMetadata, IIOMetadata imageMetadata) { return 0; @@ -553,9 +553,9 @@ public abstract class ImageWriter * if the size is unknown (insufficient information was provided) */ public Dimension[] getPreferredThumbnailSizes (ImageTypeSpecifier imageType, - ImageWriteParam param, - IIOMetadata streamMetadata, - IIOMetadata imageMetadata) + ImageWriteParam param, + IIOMetadata streamMetadata, + IIOMetadata imageMetadata) { return null; } @@ -568,14 +568,14 @@ public abstract class ImageWriter { if (progressListeners != null) { - Iterator it = progressListeners.iterator(); - - while (it.hasNext()) - { - IIOWriteProgressListener listener = - (IIOWriteProgressListener) it.next(); - listener.imageComplete(this); - } + Iterator it = progressListeners.iterator(); + + while (it.hasNext()) + { + IIOWriteProgressListener listener = + (IIOWriteProgressListener) it.next(); + listener.imageComplete(this); + } } } @@ -591,14 +591,14 @@ public abstract class ImageWriter { if (progressListeners != null) { - Iterator it = progressListeners.iterator(); - - while (it.hasNext()) - { - IIOWriteProgressListener listener = - (IIOWriteProgressListener) it.next(); - listener.imageProgress(this, percentageDone); - } + Iterator it = progressListeners.iterator(); + + while (it.hasNext()) + { + IIOWriteProgressListener listener = + (IIOWriteProgressListener) it.next(); + listener.imageProgress(this, percentageDone); + } } } @@ -614,14 +614,14 @@ public abstract class ImageWriter { if (progressListeners != null) { - Iterator it = progressListeners.iterator(); - - while (it.hasNext()) - { - IIOWriteProgressListener listener = - (IIOWriteProgressListener) it.next(); - listener.imageStarted(this, imageIndex); - } + Iterator it = progressListeners.iterator(); + + while (it.hasNext()) + { + IIOWriteProgressListener listener = + (IIOWriteProgressListener) it.next(); + listener.imageStarted(this, imageIndex); + } } } @@ -634,14 +634,14 @@ public abstract class ImageWriter { if (progressListeners != null) { - Iterator it = progressListeners.iterator(); - - while (it.hasNext()) - { - IIOWriteProgressListener listener = - (IIOWriteProgressListener) it.next(); - listener.thumbnailComplete(this); - } + Iterator it = progressListeners.iterator(); + + while (it.hasNext()) + { + IIOWriteProgressListener listener = + (IIOWriteProgressListener) it.next(); + listener.thumbnailComplete(this); + } } } @@ -657,14 +657,14 @@ public abstract class ImageWriter { if (progressListeners != null) { - Iterator it = progressListeners.iterator(); - - while (it.hasNext()) - { - IIOWriteProgressListener listener = - (IIOWriteProgressListener) it.next(); - listener.thumbnailProgress(this, percentageDone); - } + Iterator it = progressListeners.iterator(); + + while (it.hasNext()) + { + IIOWriteProgressListener listener = + (IIOWriteProgressListener) it.next(); + listener.thumbnailProgress(this, percentageDone); + } } } @@ -682,14 +682,14 @@ public abstract class ImageWriter { if (progressListeners != null) { - Iterator it = progressListeners.iterator(); - - while (it.hasNext()) - { - IIOWriteProgressListener listener = - (IIOWriteProgressListener) it.next(); - listener.thumbnailStarted(this, imageIndex, thumbnailIndex); - } + Iterator it = progressListeners.iterator(); + + while (it.hasNext()) + { + IIOWriteProgressListener listener = + (IIOWriteProgressListener) it.next(); + listener.thumbnailStarted(this, imageIndex, thumbnailIndex); + } } } @@ -707,14 +707,14 @@ public abstract class ImageWriter { if (warningListeners != null) { - Iterator it = warningListeners.iterator(); - - while (it.hasNext()) - { - IIOWriteWarningListener listener = - (IIOWriteWarningListener) it.next(); - listener.warningOccurred(this, imageIndex, warning); - } + Iterator it = warningListeners.iterator(); + + while (it.hasNext()) + { + IIOWriteWarningListener listener = + (IIOWriteWarningListener) it.next(); + listener.warningOccurred(this, imageIndex, warning); + } } } @@ -741,8 +741,8 @@ public abstract class ImageWriter * not a String */ protected void processWarningOccurred(int imageIndex, - String baseName, - String keyword) + String baseName, + String keyword) { if (baseName == null || keyword == null) throw new IllegalArgumentException ("null argument"); @@ -751,22 +751,22 @@ public abstract class ImageWriter try { - b = ResourceBundle.getBundle(baseName, getLocale()); + b = ResourceBundle.getBundle(baseName, getLocale()); } catch (MissingResourceException e) { - throw new IllegalArgumentException ("no resource bundle found"); + throw new IllegalArgumentException ("no resource bundle found"); } Object str = null; try { - str = b.getObject(keyword); + str = b.getObject(keyword); } catch (MissingResourceException e) { - throw new IllegalArgumentException ("no results found for keyword"); + throw new IllegalArgumentException ("no results found for keyword"); } if (! (str instanceof String)) @@ -776,14 +776,14 @@ public abstract class ImageWriter if (warningListeners != null) { - Iterator it = warningListeners.iterator(); - - while (it.hasNext()) - { - IIOWriteWarningListener listener = - (IIOWriteWarningListener) it.next(); - listener.warningOccurred(this, imageIndex, warning); - } + Iterator it = warningListeners.iterator(); + + while (it.hasNext()) + { + IIOWriteWarningListener listener = + (IIOWriteWarningListener) it.next(); + listener.warningOccurred(this, imageIndex, warning); + } } } @@ -791,18 +791,18 @@ public abstract class ImageWriter * Notifies all installed write progress listeners that image * loading has been aborted by calling their writeAborted methods. */ - protected void processWriteAborted() + protected void processWriteAborted() { if (progressListeners != null) { - Iterator it = progressListeners.iterator(); - - while (it.hasNext()) - { - IIOWriteProgressListener listener = - (IIOWriteProgressListener) it.next(); - listener.writeAborted(this); - } + Iterator it = progressListeners.iterator(); + + while (it.hasNext()) + { + IIOWriteProgressListener listener = + (IIOWriteProgressListener) it.next(); + listener.writeAborted(this); + } } } @@ -813,7 +813,7 @@ public abstract class ImageWriter { if (progressListeners != null) { - progressListeners.clear(); + progressListeners.clear(); } } @@ -824,7 +824,7 @@ public abstract class ImageWriter { if (progressListeners != null) { - progressListeners.clear(); + progressListeners.clear(); } } @@ -839,7 +839,7 @@ public abstract class ImageWriter return; if (progressListeners != null) { - progressListeners.remove(listener); + progressListeners.remove(listener); } } /** @@ -853,7 +853,7 @@ public abstract class ImageWriter return; if (warningListeners != null) { - warningListeners.remove(listener); + warningListeners.remove(listener); } } /** @@ -867,7 +867,7 @@ public abstract class ImageWriter removeAllIIOWriteProgressListeners(); clearAbortRequest(); } - + /** * Set the current locale or use the default locale. * @@ -877,16 +877,16 @@ public abstract class ImageWriter { if (locale != null) { - // Check if its a valid locale. - boolean found = false; + // Check if its a valid locale. + boolean found = false; - if (availableLocales != null) - for (int i = availableLocales.length - 1; i >= 0; --i) - if (availableLocales[i].equals(locale)) - found = true; + if (availableLocales != null) + for (int i = availableLocales.length - 1; i >= 0; --i) + if (availableLocales[i].equals(locale)) + found = true; - if (! found) - throw new IllegalArgumentException("looale not available"); + if (! found) + throw new IllegalArgumentException("looale not available"); } this.locale = locale; @@ -908,20 +908,20 @@ public abstract class ImageWriter { if (output != null) { - // Check if its a valid output object. - boolean found = false; - Class[] types = null; - - if (originatingProvider != null) - types = originatingProvider.getOutputTypes(); - - if (types != null) - for (int i = types.length - 1; i >= 0; --i) + // Check if its a valid output object. + boolean found = false; + Class[] types = null; + + if (originatingProvider != null) + types = originatingProvider.getOutputTypes(); + + if (types != null) + for (int i = types.length - 1; i >= 0; --i) if (types[i].isInstance(output)) found = true; - if (! found) - throw new IllegalArgumentException("output type not available"); + if (! found) + throw new IllegalArgumentException("output type not available"); } this.output = output; diff --git a/libjava/classpath/javax/imageio/event/IIOReadProgressListener.java b/libjava/classpath/javax/imageio/event/IIOReadProgressListener.java index 404336c24bf..0eea6101772 100644 --- a/libjava/classpath/javax/imageio/event/IIOReadProgressListener.java +++ b/libjava/classpath/javax/imageio/event/IIOReadProgressListener.java @@ -46,7 +46,7 @@ public interface IIOReadProgressListener extends EventListener { /** * Reports that the current image read operation has completed. - * + * * @param source the <code>ImageReader</code> object calling this method */ void imageComplete(ImageReader source); @@ -54,7 +54,7 @@ public interface IIOReadProgressListener extends EventListener /** * Reports the approximate percentage of completions of this image read * operation. - * + * * @param source the <code>ImageReader</code> object calling this method * @param percentageDone the approximate percentage of encoding completed */ @@ -62,7 +62,7 @@ public interface IIOReadProgressListener extends EventListener /** * Reports that the current image read operation has started. - * + * * @param source the <code>ImageReader</code> object calling this method * @param imageIndex the index of the image to read */ @@ -70,21 +70,21 @@ public interface IIOReadProgressListener extends EventListener /** * Reports that a read operation has been aborted. - * + * * @param source the <code>ImageReader</code> object calling this method */ void readAborted(ImageReader source); /** * Reports that a sequence of read operationshas completed. - * + * * @param source the <code>ImageReader</code> object calling this method */ void sequenceComplete(ImageReader source); /** * Reports that a sequence of read operations is beginning. - * + * * @param source the <code>ImageReader</code> object calling this method * @param minIndex the index of the first image to be read */ @@ -92,7 +92,7 @@ public interface IIOReadProgressListener extends EventListener /** * Reports that a thumbnail read operation has completed. - * + * * @param source the <code>ImageReader</code> object calling this method */ void thumbnailComplete(ImageReader source); @@ -100,7 +100,7 @@ public interface IIOReadProgressListener extends EventListener /** * Reports the approximate percentage of completion of a thumbnail read * operation. - * + * * @param source the <code>ImageReader</code> object calling this method * @param percentageDone the approximate percentage of encoding completed */ @@ -108,7 +108,7 @@ public interface IIOReadProgressListener extends EventListener /** * Reports that a thumbnail read operation is beginning. - * + * * @param source the <code>ImageReader</code> object calling this method * @param imageIndex the index of the image being read * @param thumbnailIndex the index of the thumbnail being read diff --git a/libjava/classpath/javax/imageio/event/IIOReadUpdateListener.java b/libjava/classpath/javax/imageio/event/IIOReadUpdateListener.java index 77b1a4e0718..a20a99ebceb 100644 --- a/libjava/classpath/javax/imageio/event/IIOReadUpdateListener.java +++ b/libjava/classpath/javax/imageio/event/IIOReadUpdateListener.java @@ -47,7 +47,7 @@ public interface IIOReadUpdateListener extends EventListener { /** * Reports that a given region of the image has been updated. - * + * * @param source the <code>ImageReader</code> object calling this method * @param image the BufferedImage being updated * @param minX the X coordinate of the leftmost updated column of pixels @@ -64,7 +64,7 @@ public interface IIOReadUpdateListener extends EventListener /** * Reports that the current read operation has completed a progressive pass. - * + * * @param source the <code>ImageReader</code> object calling this method * @param image the BufferedImage being updated */ @@ -72,7 +72,7 @@ public interface IIOReadUpdateListener extends EventListener /** * Reports that the current read operation is about to begin a progressive pass. - * + * * @param source the <code>ImageReader</code> object calling this method * @param image the BufferedImage being updated * @param pass the numer of the pass that is about to begin, starting with 0 @@ -90,7 +90,7 @@ public interface IIOReadUpdateListener extends EventListener /** * Reports that the current thumbnail read operation has completed a progressive pass. - * + * * @param source the <code>ImageReader</code> object calling this method * @param image the BufferedImage being updated */ @@ -98,7 +98,7 @@ public interface IIOReadUpdateListener extends EventListener /** * Reports that the current thumbnail read operation is about to begin a progressive pass. - * + * * @param source the <code>ImageReader</code> object calling this method * @param image the BufferedImage being updated * @param pass the numer of the pass that is about to begin, starting with 0 diff --git a/libjava/classpath/javax/imageio/event/IIOWriteProgressListener.java b/libjava/classpath/javax/imageio/event/IIOWriteProgressListener.java index 16b8891f0f2..d7597620590 100644 --- a/libjava/classpath/javax/imageio/event/IIOWriteProgressListener.java +++ b/libjava/classpath/javax/imageio/event/IIOWriteProgressListener.java @@ -46,7 +46,7 @@ public interface IIOWriteProgressListener extends EventListener { /** * Reports that an image write operation has completed. - * + * * @param source the <code>ImageWriter</code> object calling this method */ void imageComplete(ImageWriter source); @@ -54,7 +54,7 @@ public interface IIOWriteProgressListener extends EventListener /** * Reports the approximate percentage of completion of an image write * operation. - * + * * @param source the <code>ImageWriter</code> object calling this method * @param percentageDone the approximate percentage of decoding completed */ @@ -62,7 +62,7 @@ public interface IIOWriteProgressListener extends EventListener /** * Reports that a thumbnail write operation has started. - * + * * @param source the <code>ImageWriter</code> object calling this method * @param imageIndex the index of the image being written */ @@ -70,7 +70,7 @@ public interface IIOWriteProgressListener extends EventListener /** * Reports that a thumbnail write operation has completed. - * + * * @param source the <code>ImageWriter</code> object calling this method */ void thumbnailComplete(ImageWriter source); @@ -78,7 +78,7 @@ public interface IIOWriteProgressListener extends EventListener /** * Reports the approximate percentage of completion of a thumbnail write * operation. - * + * * @param source the <code>ImageWriter</code> object calling this method * @param percentageDone the approximate percentage of decoding completed */ @@ -86,7 +86,7 @@ public interface IIOWriteProgressListener extends EventListener /** * Reports that a thumbnail write operation is beginning. - * + * * @param source the <code>ImageWriter</code> object calling this method * @param imageIndex the index of the image being written * @param thumnailIndex the index of the thumbnail being written @@ -95,7 +95,7 @@ public interface IIOWriteProgressListener extends EventListener /** * Reports that an image write operation is aborted. - * + * * @param source the <code>ImageWriter</code> object calling this method */ void writeAborted(ImageWriter source); diff --git a/libjava/classpath/javax/imageio/metadata/IIOInvalidTreeException.java b/libjava/classpath/javax/imageio/metadata/IIOInvalidTreeException.java index 18d5bf617b1..b79b8cf9627 100644 --- a/libjava/classpath/javax/imageio/metadata/IIOInvalidTreeException.java +++ b/libjava/classpath/javax/imageio/metadata/IIOInvalidTreeException.java @@ -55,7 +55,7 @@ public class IIOInvalidTreeException extends IIOException } public IIOInvalidTreeException(String message, Throwable cause, - Node offendingNode) + Node offendingNode) { super(message, cause); this.offendingNode = offendingNode; diff --git a/libjava/classpath/javax/imageio/metadata/IIOMetadata.java b/libjava/classpath/javax/imageio/metadata/IIOMetadata.java index e5105de2caf..b898b994232 100644 --- a/libjava/classpath/javax/imageio/metadata/IIOMetadata.java +++ b/libjava/classpath/javax/imageio/metadata/IIOMetadata.java @@ -162,39 +162,39 @@ public abstract class IIOMetadata { if (formatName == null) throw new IllegalArgumentException("formatName may not be null"); - + String formatClassName = null; if (isStandardMetadataFormatSupported() - && formatName.equals(nativeMetadataFormatName)) + && formatName.equals(nativeMetadataFormatName)) formatClassName = nativeMetadataFormatClassName; else { - String[] extraFormatNames = getExtraMetadataFormatNames(); - - for (int i = extraFormatNames.length - 1; i >= 0; --i) - if (extraFormatNames[i].equals(formatName)) - { - formatClassName = extraFormatNames[i]; - break; - } + String[] extraFormatNames = getExtraMetadataFormatNames(); + + for (int i = extraFormatNames.length - 1; i >= 0; --i) + if (extraFormatNames[i].equals(formatName)) + { + formatClassName = extraFormatNames[i]; + break; + } } if (formatClassName == null) throw new IllegalArgumentException("unknown format"); IIOMetadataFormat format; - + try { - format = (IIOMetadataFormat) Class.forName(formatClassName) - .newInstance(); + format = (IIOMetadataFormat) Class.forName(formatClassName) + .newInstance(); } catch (Exception e) { - IllegalStateException ise = new IllegalStateException(); - ise.initCause(e); - throw ise; + IllegalStateException ise = new IllegalStateException(); + ise.initCause(e); + throw ise; } return format; @@ -203,18 +203,18 @@ public abstract class IIOMetadata public String[] getMetadataFormatNames() { String[] formatNames = getExtraMetadataFormatNames(); - + if (isStandardMetadataFormatSupported()) { // Combine native metadata format name and extra metadata format names - // into one String array. - String[] tmp = new String[formatNames.length + 1]; - tmp[0] = getNativeMetadataFormatName(); + // into one String array. + String[] tmp = new String[formatNames.length + 1]; + tmp[0] = getNativeMetadataFormatName(); - for (int i = 1; i < tmp.length; ++i) - tmp[i] = formatNames[i - 1]; + for (int i = 1; i < tmp.length; ++i) + tmp[i] = formatNames[i - 1]; - formatNames = tmp; + formatNames = tmp; } return formatNames; @@ -287,7 +287,7 @@ public abstract class IIOMetadata } private void appendChild (IIOMetadataNode node, - IIOMetadataNode child) + IIOMetadataNode child) { if (child != null) node.appendChild(child); diff --git a/libjava/classpath/javax/imageio/metadata/IIOMetadataFormatImpl.java b/libjava/classpath/javax/imageio/metadata/IIOMetadataFormatImpl.java index 444497d7dc5..efea723f9ab 100644 --- a/libjava/classpath/javax/imageio/metadata/IIOMetadataFormatImpl.java +++ b/libjava/classpath/javax/imageio/metadata/IIOMetadataFormatImpl.java @@ -88,18 +88,18 @@ public abstract class IIOMetadataFormatImpl implements IIOMetadataFormat protected String defaultValue; public IIOMetadataNodeAttr (Element owner, - String name, - String defaultValue) + String name, + String defaultValue) { this (owner, name, IIOMetadataFormat.DATATYPE_STRING, true, defaultValue); } public IIOMetadataNodeAttr (Element owner, - String name, - int dataType, - boolean required, - String defaultValue) + String name, + int dataType, + boolean required, + String defaultValue) { this.owner = owner; this.name = name; @@ -160,11 +160,11 @@ public abstract class IIOMetadataFormatImpl implements IIOMetadataFormat protected List enumeratedValues; public IIOMetadataNodeAttrEnumerated (Element owner, - String name, - int dataType, - boolean required, - String defaultValue, - List enumeratedValues) + String name, + int dataType, + boolean required, + String defaultValue, + List enumeratedValues) { super (owner, name, dataType, required, defaultValue); this.enumeratedValues = new ArrayList (enumeratedValues); @@ -184,14 +184,14 @@ public abstract class IIOMetadataFormatImpl implements IIOMetadataFormat protected boolean maxInclusive; public IIOMetadataNodeAttrBounded (Element owner, - String name, - int dataType, - boolean required, - String defaultValue, - String minValue, - String maxValue, - boolean minInclusive, - boolean maxInclusive) + String name, + int dataType, + boolean required, + String defaultValue, + String minValue, + String maxValue, + boolean minInclusive, + boolean maxInclusive) { super (owner, name, dataType, required, defaultValue); this.minValue = minValue; @@ -217,11 +217,11 @@ public abstract class IIOMetadataFormatImpl implements IIOMetadataFormat protected int listMaxLength; public IIOMetadataNodeAttrList (Element owner, - String name, - int dataType, - boolean required, - int listMinLength, - int listMaxLength) + String name, + int dataType, + boolean required, + int listMinLength, + int listMaxLength) { super (owner, name, dataType, required, null); this.listMinLength = listMinLength; @@ -398,8 +398,8 @@ public abstract class IIOMetadataFormatImpl implements IIOMetadataFormat throw new IllegalArgumentException ("null argument"); if (childPolicy < IIOMetadataFormat.CHILD_POLICY_ALL - || childPolicy > IIOMetadataFormat.CHILD_POLICY_SOME - || childPolicy == IIOMetadataFormat.CHILD_POLICY_REPEAT) + || childPolicy > IIOMetadataFormat.CHILD_POLICY_SOME + || childPolicy == IIOMetadataFormat.CHILD_POLICY_REPEAT) throw new IllegalArgumentException ("wrong child policy"); nodes.put (rootName, new IIOMetadataNode (rootName)); @@ -423,8 +423,8 @@ public abstract class IIOMetadataFormatImpl implements IIOMetadataFormat * zero or greater than maxChildren */ public IIOMetadataFormatImpl (String rootName, - int minChildren, - int maxChildren) + int minChildren, + int maxChildren) { if (rootName == null) throw new IllegalArgumentException ("null argument"); @@ -446,10 +446,10 @@ public abstract class IIOMetadataFormatImpl implements IIOMetadataFormat { IIOMetadataNode node = (IIOMetadataNode) nodes.get (elementName); node.setAttributeNode (new IIOMetadataNodeAttr (node, - attrName, - dataType, - required, - defaultValue)); + attrName, + dataType, + required, + defaultValue)); } protected void addAttribute (String elementName, @@ -461,11 +461,11 @@ public abstract class IIOMetadataFormatImpl implements IIOMetadataFormat { IIOMetadataNode node = (IIOMetadataNode) nodes.get (elementName); node.setAttributeNode (new IIOMetadataNodeAttrEnumerated (node, - attrName, - dataType, - required, - defaultValue, - enumeratedValues)); + attrName, + dataType, + required, + defaultValue, + enumeratedValues)); } protected void addAttribute (String elementName, @@ -480,14 +480,14 @@ public abstract class IIOMetadataFormatImpl implements IIOMetadataFormat { IIOMetadataNode node = (IIOMetadataNode) nodes.get (elementName); node.setAttributeNode (new IIOMetadataNodeAttrBounded (node, - attrName, - dataType, - required, - defaultValue, - minValue, - maxValue, - minInclusive, - maxInclusive)); + attrName, + dataType, + required, + defaultValue, + minValue, + maxValue, + minInclusive, + maxInclusive)); } protected void addAttribute (String elementName, @@ -499,11 +499,11 @@ public abstract class IIOMetadataFormatImpl implements IIOMetadataFormat { IIOMetadataNode node = (IIOMetadataNode) nodes.get (elementName); node.setAttributeNode (new IIOMetadataNodeAttrList (node, - attrName, - dataType, - required, - listMinLength, - listMaxLength)); + attrName, + dataType, + required, + listMinLength, + listMaxLength)); } protected void addBooleanAttribute (String elementName, @@ -518,11 +518,11 @@ public abstract class IIOMetadataFormatImpl implements IIOMetadataFormat enumeratedValues.add ("FALSE"); node.setAttributeNode (new IIOMetadataNodeAttrEnumerated (node, - attrName, - IIOMetadataFormat.DATATYPE_BOOLEAN, - hasDefaultValue, - defaultValue ? "TRUE" : "FALSE", - enumeratedValues)); + attrName, + IIOMetadataFormat.DATATYPE_BOOLEAN, + hasDefaultValue, + defaultValue ? "TRUE" : "FALSE", + enumeratedValues)); } protected void addChildElement (String elementName, String parentName) diff --git a/libjava/classpath/javax/imageio/metadata/IIOMetadataNode.java b/libjava/classpath/javax/imageio/metadata/IIOMetadataNode.java index 37269f53916..db3de234708 100644 --- a/libjava/classpath/javax/imageio/metadata/IIOMetadataNode.java +++ b/libjava/classpath/javax/imageio/metadata/IIOMetadataNode.java @@ -165,7 +165,7 @@ public class IIOMetadataNode private class IIONodeList implements NodeList { List children = new ArrayList(); - + /* (non-Javadoc) * @see org.w3c.dom.NodeList#item(int) */ @@ -187,7 +187,7 @@ public class IIOMetadataNode { // Do nothing here. } - + public IIOMetadataNode(String nodename) { name = nodename; @@ -202,7 +202,7 @@ public class IIOMetadataNode { obj = o; } - + public short compareDocumentPosition(Node other) throws DOMException { @@ -260,7 +260,7 @@ public class IIOMetadataNode getElementsRecurse(list, name); } } - + /* (non-Javadoc) * @see org.w3c.dom.Element#getElementsByTagName(java.lang.String) */ @@ -280,7 +280,7 @@ public class IIOMetadataNode getElementsRecurse(list, name); return list; } - + /* (non-Javadoc) * @see org.w3c.dom.Element#getTagName() */ @@ -288,7 +288,7 @@ public class IIOMetadataNode { return name; } - + /* (non-Javadoc) * @see org.w3c.dom.Element#hasAttribute(java.lang.String) */ @@ -296,7 +296,7 @@ public class IIOMetadataNode { return attrs.containsKey(name); } - + /* (non-Javadoc) * @see org.w3c.dom.Element#hasAttributeNS(java.lang.String, java.lang.String) */ @@ -304,7 +304,7 @@ public class IIOMetadataNode { return attrs.containsKey(localName); } - + /* (non-Javadoc) * @see org.w3c.dom.Element#removeAttribute(java.lang.String) */ @@ -320,7 +320,7 @@ public class IIOMetadataNode { return (Attr)attrs.remove(oldAttr.getName()); } - + /* (non-Javadoc) * @see org.w3c.dom.Element#removeAttributeNS(java.lang.String, java.lang.String) */ @@ -328,7 +328,7 @@ public class IIOMetadataNode { removeAttribute(localName); } - + /* (non-Javadoc) * @see org.w3c.dom.Element#setAttribute(java.lang.String, java.lang.String) */ @@ -340,7 +340,7 @@ public class IIOMetadataNode else attrs.put(name, new IIOMetadataNodeAttr(this, name, value)); } - + /* (non-Javadoc) * @see org.w3c.dom.Element#setAttributeNode(org.w3c.dom.Attr) */ @@ -348,7 +348,7 @@ public class IIOMetadataNode { return (Attr)attrs.put(newAttr.getName(), newAttr); } - + /* (non-Javadoc) * @see org.w3c.dom.Element#setAttributeNodeNS(org.w3c.dom.Attr) */ @@ -356,15 +356,15 @@ public class IIOMetadataNode { return (Attr)attrs.put(newAttr.getName(), newAttr); } - + /* (non-Javadoc) * @see org.w3c.dom.Element#setAttributeNS(java.lang.String, java.lang.String, java.lang.String) */ public void setAttributeNS(String namespaceURI, String qualifiedName, String value) { - setAttribute(qualifiedName, value); + setAttribute(qualifiedName, value); } - + /* (non-Javadoc) * @see org.w3c.dom.NodeList#getLength() */ @@ -372,7 +372,7 @@ public class IIOMetadataNode { return children.size(); } - + /* (non-Javadoc) * @see org.w3c.dom.NodeList#item(int) */ @@ -383,7 +383,7 @@ public class IIOMetadataNode else return null; } - + /* (non-Javadoc) * @see org.w3c.dom.Node#appendChild(org.w3c.dom.Node) */ @@ -391,9 +391,9 @@ public class IIOMetadataNode { if (newChild == null) throw new IllegalArgumentException("Child node is null"); - + IIOMetadataNode child = (IIOMetadataNode) newChild; - + children.add(child); child.parent = this; return this; @@ -412,7 +412,7 @@ public class IIOMetadataNode for (int i=0; i < children.size(); i++) newnode.children.add(((Node)children.get(i)).cloneNode(deep)); } - + // clone attrs for (Iterator it = attrs.values().iterator(); it.hasNext();) { @@ -452,7 +452,7 @@ public class IIOMetadataNode { return (children.size() > 0) ? (Node)children.get(0) : null; } - + /* (non-Javadoc) * @see org.w3c.dom.Node#getLastChild() */ @@ -469,7 +469,7 @@ public class IIOMetadataNode { return name; } - + /* (non-Javadoc) * @see org.w3c.dom.Node#getNamespaceURI() */ @@ -477,7 +477,7 @@ public class IIOMetadataNode { return null; } - + /* (non-Javadoc) * @see org.w3c.dom.Node#getNextSibling() */ @@ -497,7 +497,7 @@ public class IIOMetadataNode { return name; } - + /* (non-Javadoc) * @see org.w3c.dom.Node#getNodeType() */ @@ -530,7 +530,7 @@ public class IIOMetadataNode { return parent; } - + /* (non-Javadoc) * @see org.w3c.dom.Node#getPrefix() */ @@ -538,7 +538,7 @@ public class IIOMetadataNode { return null; } - + /* (non-Javadoc) * @see org.w3c.dom.Node#getPreviousSibling() */ @@ -566,7 +566,7 @@ public class IIOMetadataNode { return null; } - + /* (non-Javadoc) * @see org.w3c.dom.Node#hasAttributes() */ @@ -574,7 +574,7 @@ public class IIOMetadataNode { return !attrs.isEmpty(); } - + /* (non-Javadoc) * @see org.w3c.dom.Node#hasChildNodes() */ @@ -590,14 +590,14 @@ public class IIOMetadataNode { if (newChild == null) throw new IllegalArgumentException(); - + int idx = children.indexOf(refChild); if (idx == -1) children.add(newChild); else children.add(idx, newChild); ((IIOMetadataNode)newChild).parent = this; - + return newChild; } @@ -610,12 +610,12 @@ public class IIOMetadataNode { return true; } - + public boolean isSameNode(Node other) { return this == other; } - + /* (non-Javadoc) * @see org.w3c.dom.Node#isSupported(java.lang.String, java.lang.String) */ @@ -624,12 +624,12 @@ public class IIOMetadataNode // No DOM features are supported return false; } - + public String lookupNamespaceURI(String prefix) { return null; } - + public String lookupPrefix(String namespaceURI) { return null; @@ -667,7 +667,7 @@ public class IIOMetadataNode ((IIOMetadataNode)oldChild).parent = null; return oldChild; } - + public void setIdAttribute(String name, boolean isId) throws DOMException { @@ -682,14 +682,14 @@ public class IIOMetadataNode throws DOMException { } - + /* (non-Javadoc) * @see org.w3c.dom.Node#setNodeValue(java.lang.String) */ public void setNodeValue(String nodeValue) throws DOMException { } - + /* (non-Javadoc) * @see org.w3c.dom.Node#setPrefix(java.lang.String) */ @@ -701,7 +701,7 @@ public class IIOMetadataNode throws DOMException { } - + public Object setUserData(String key, Object data, UserDataHandler handler) { return null; diff --git a/libjava/classpath/javax/imageio/plugins/bmp/BMPImageWriteParam.java b/libjava/classpath/javax/imageio/plugins/bmp/BMPImageWriteParam.java index de59efba4ea..cc0e0d34cf2 100644 --- a/libjava/classpath/javax/imageio/plugins/bmp/BMPImageWriteParam.java +++ b/libjava/classpath/javax/imageio/plugins/bmp/BMPImageWriteParam.java @@ -1,4 +1,4 @@ -/* BMPImageWriteParam.java -- +/* BMPImageWriteParam.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -43,25 +43,25 @@ import java.util.Locale; import javax.imageio.ImageWriteParam; /** - * A class to encode images in the BMP format. + * A class to encode images in the BMP format. * By default, the data layout is bottom-up, such that the pixels are stored in - * bottom-up order. - * - * The compression scheme can be specified by using setCompressionType() + * bottom-up order. + * + * The compression scheme can be specified by using setCompressionType() * appropriate type string. The compression scheme specified will be honored - * if it is compatible with the type of image being written. If the + * if it is compatible with the type of image being written. If the * compression scheme is not compatible with the type of image being written, - * then an IOException will be thrown by the BMP image writer. If the + * then an IOException will be thrown by the BMP image writer. If the * compression type is not set, then getCompressionType() will return null. - * In this case the BMP image writer will select a compression type that - * supports encoding of the given image without loss of the color resolution. - * - * The compression type strings and the image type each supports are: - * Uncompressed RLE: BI_RGB, image type: <= 8-bits/sample. - * 8-bit Run Length Encoding: BI_RLE8, image type: <= 8-bits/sample - * 4-bit Run Length Encoding: BI_RLE4, image type: <= 4-bits/sample + * In this case the BMP image writer will select a compression type that + * supports encoding of the given image without loss of the color resolution. + * + * The compression type strings and the image type each supports are: + * Uncompressed RLE: BI_RGB, image type: <= 8-bits/sample. + * 8-bit Run Length Encoding: BI_RLE8, image type: <= 8-bits/sample + * 4-bit Run Length Encoding: BI_RLE4, image type: <= 4-bits/sample * Packed data: BI_BITFIELDS, image type: 16 or 32 bits/sample - * + * * @author Lillian Angel (langel at redhat dot com) */ public class BMPImageWriteParam @@ -72,7 +72,7 @@ public class BMPImageWriteParam * This boolean is true if the data will be written in a topdown manner. */ private boolean topDown; - + /** * Compression type strings. */ @@ -80,7 +80,7 @@ public class BMPImageWriteParam String rle8 = "BI_RLE8"; String rle4 = "BI_RLE4"; String bitfields = "BI_BITFIELDS"; - + /** * Constants to represent image types. */ @@ -88,7 +88,7 @@ public class BMPImageWriteParam static final int BI_RLE8 = 1; static final int BI_RLE4 = 2; static final int BI_BITFIELDS = 3; - + /** * Constructs an <code>BMPImageWriteParam</code> object with default values * and a <code>null Locale</code>. @@ -101,7 +101,7 @@ public class BMPImageWriteParam /** * Constructs a <code>BMPImageWriteParam</code> set to use a given * <code>Locale</code> and with default values for all parameters. - * + * * @param locale - a <code>Locale</code> to be used to localize compression * type names and quality descriptions, or <code>null</code>. */ @@ -110,20 +110,20 @@ public class BMPImageWriteParam super(locale); topDown = false; canWriteCompressed = true; - + compressionTypes = new String[4]; compressionTypes[BI_RGB] = rgb; compressionTypes[BI_RLE8] = rle8; compressionTypes[BI_RLE4] = rle4; compressionTypes[BI_BITFIELDS] = bitfields; - + compressionType = compressionTypes[BI_RGB]; } /** * If set, the data will be written out in a top-down manner, the first * scanline being written first. - * + * * @param topDown - whether the data are written in top-down order. */ public void setTopDown(boolean topDown) @@ -134,7 +134,7 @@ public class BMPImageWriteParam /** * Returns the value of the <code>topDown</code> parameter. The default is * false. - * + * * @return whether the data are written in top-down order. */ public boolean isTopDown() diff --git a/libjava/classpath/javax/imageio/plugins/jpeg/JPEGHuffmanTable.java b/libjava/classpath/javax/imageio/plugins/jpeg/JPEGHuffmanTable.java index 378e11fa617..be718d4fce5 100644 --- a/libjava/classpath/javax/imageio/plugins/jpeg/JPEGHuffmanTable.java +++ b/libjava/classpath/javax/imageio/plugins/jpeg/JPEGHuffmanTable.java @@ -162,7 +162,7 @@ public class JPEGHuffmanTable * the array arguments. lengths[index] stores the number of Huffman * values with Huffman codes of length index + 1. The values array * stores the Huffman values in order of increasing code length. - * + * * @param lengths an array of Huffman code lengths * @param values a sorted array of Huffman values * @throws IllegalArgumentException if either parameter is null, if @@ -266,17 +266,17 @@ public class JPEGHuffmanTable public String toString() { CPStringBuilder buffer = new CPStringBuilder(); - + buffer.append("JPEGHuffmanTable:\nlengths:"); - + for (int i = 0; i < lengths.length; i++) buffer.append(" " + lengths[i]); - + buffer.append("\nvalues:"); - + for (int i = 0; i < values.length; i++) buffer.append(" " + values[i]); - + return buffer.toString(); } } diff --git a/libjava/classpath/javax/imageio/spi/IIORegistry.java b/libjava/classpath/javax/imageio/spi/IIORegistry.java index 101cead4ef3..faa571d6074 100644 --- a/libjava/classpath/javax/imageio/spi/IIORegistry.java +++ b/libjava/classpath/javax/imageio/spi/IIORegistry.java @@ -54,7 +54,7 @@ import gnu.javax.imageio.png.PNGImageReaderSpi; public final class IIORegistry extends ServiceRegistry { private static final HashSet defaultCategories = new HashSet(); - + private static HashMap instances = new HashMap(); static @@ -65,19 +65,19 @@ public final class IIORegistry extends ServiceRegistry defaultCategories.add(ImageInputStreamSpi.class); defaultCategories.add(ImageOutputStreamSpi.class); } - + public static synchronized IIORegistry getDefaultInstance() { // XXX: This leaks memory if a ThreadGroup isn't available anymore. ThreadGroup group = Thread.currentThread().getThreadGroup(); IIORegistry registry = (IIORegistry) instances.get(group); - + if (registry == null) { registry = new IIORegistry(); instances.put(group, registry); } - + return registry; } @@ -94,7 +94,7 @@ public final class IIORegistry extends ServiceRegistry Toolkit toolkit = Toolkit.getDefaultToolkit(); if (toolkit instanceof ClasspathToolkit) ((ClasspathToolkit)toolkit).registerImageIOSpis(this); - + registerApplicationClasspathSpis(); } @@ -109,11 +109,11 @@ public final class IIORegistry extends ServiceRegistry while (categories.hasNext()) { - Class category = (Class) categories.next(); - Iterator providers = ServiceFactory.lookupProviders(category, loader); + Class category = (Class) categories.next(); + Iterator providers = ServiceFactory.lookupProviders(category, loader); - while (providers.hasNext()) - registerServiceProvider((IIOServiceProvider) providers.next()); + while (providers.hasNext()) + registerServiceProvider((IIOServiceProvider) providers.next()); } } } diff --git a/libjava/classpath/javax/imageio/spi/ImageReaderSpi.java b/libjava/classpath/javax/imageio/spi/ImageReaderSpi.java index e97d23940ca..3ffa93a0b9e 100644 --- a/libjava/classpath/javax/imageio/spi/ImageReaderSpi.java +++ b/libjava/classpath/javax/imageio/spi/ImageReaderSpi.java @@ -84,7 +84,7 @@ public abstract class ImageReaderSpi extends ImageReaderWriterSpi if (inputTypes == null || inputTypes.length == 0) throw new IllegalArgumentException("inputTypes may not be null or empty"); - + this.inputTypes = inputTypes; this.writerSpiNames = writerSpiNames; } @@ -115,7 +115,7 @@ public abstract class ImageReaderSpi extends ImageReaderWriterSpi { if (reader == null) throw new IllegalArgumentException("reader may not be null"); - + return pluginClassName.equals(reader.getClass().getName()); } } diff --git a/libjava/classpath/javax/imageio/spi/ImageWriterSpi.java b/libjava/classpath/javax/imageio/spi/ImageWriterSpi.java index 3ec52c51c23..6a07348cf00 100644 --- a/libjava/classpath/javax/imageio/spi/ImageWriterSpi.java +++ b/libjava/classpath/javax/imageio/spi/ImageWriterSpi.java @@ -89,9 +89,9 @@ public abstract class ImageWriterSpi extends ImageReaderWriterSpi if (outputTypes == null || outputTypes.length == 0) throw new IllegalArgumentException("outputTypes may not be null or empty"); - + this.outputTypes = outputTypes; - this.readerSpiNames = readerSpiNames; + this.readerSpiNames = readerSpiNames; } public abstract boolean canEncodeImage(ImageTypeSpecifier type); diff --git a/libjava/classpath/javax/imageio/spi/RegisterableService.java b/libjava/classpath/javax/imageio/spi/RegisterableService.java index 7be5a1beace..b424e04a3fc 100644 --- a/libjava/classpath/javax/imageio/spi/RegisterableService.java +++ b/libjava/classpath/javax/imageio/spi/RegisterableService.java @@ -80,4 +80,3 @@ public interface RegisterableService */ void onDeregistration(ServiceRegistry registry, Class<?> category); } - diff --git a/libjava/classpath/javax/imageio/spi/ServiceRegistry.java b/libjava/classpath/javax/imageio/spi/ServiceRegistry.java index 170ea009ad7..d9235968801 100644 --- a/libjava/classpath/javax/imageio/spi/ServiceRegistry.java +++ b/libjava/classpath/javax/imageio/spi/ServiceRegistry.java @@ -107,11 +107,11 @@ public class ServiceRegistry */ private IdentityHashMap[] constraints; - + /** * Constructs a <code>ServiceRegistry</code> for the specified * service categories. - * + * * @param categories the categories to support * * @throws IllegalArgumentException if <code>categories</code> is @@ -475,8 +475,8 @@ public class ServiceRegistry return deregisterServiceProvider(provider, i); throw new IllegalArgumentException(); } - - + + /** * De-registers a provider from all service categories it * implements. @@ -704,7 +704,7 @@ public class ServiceRegistry provs = providers[catid]; if (provs == null) return Collections.EMPTY_LIST.iterator(); - + result = new ArrayList(provs.size()); for (Iterator iter = provs.iterator(); iter.hasNext();) { @@ -728,7 +728,7 @@ public class ServiceRegistry if (o1 == o2) return 0; - + s = (Set) cons.get(o1); if (s != null && s.contains(o2)) return -1; // o1 < o2 @@ -749,7 +749,7 @@ public class ServiceRegistry /** * Returns one of the service providers that is a subclass of the * specified class. - * + * * @param providerClass a class to search for. */ public synchronized <T> T getServiceProviderByClass(Class<T> providerClass) @@ -764,7 +764,7 @@ public class ServiceRegistry { if (!categories[cat].isAssignableFrom(providerClass)) continue; - + LinkedList provs = providers[cat]; if (provs == null) continue; @@ -959,4 +959,3 @@ public class ServiceRegistry boolean filter(Object provider); } } - diff --git a/libjava/classpath/javax/imageio/stream/FileCacheImageInputStream.java b/libjava/classpath/javax/imageio/stream/FileCacheImageInputStream.java index 40fed63af01..2717e079dfc 100644 --- a/libjava/classpath/javax/imageio/stream/FileCacheImageInputStream.java +++ b/libjava/classpath/javax/imageio/stream/FileCacheImageInputStream.java @@ -49,7 +49,7 @@ public class FileCacheImageInputStream extends ImageInputStreamImpl { private InputStream stream; private File cacheDir; - + public FileCacheImageInputStream(InputStream stream, File cacheDir) throws IOException { @@ -64,8 +64,8 @@ public class FileCacheImageInputStream extends ImageInputStreamImpl { if (stream != null) { - stream.close(); - stream = null; + stream.close(); + stream = null; } } @@ -85,7 +85,7 @@ public class FileCacheImageInputStream extends ImageInputStreamImpl { return true; } - + public boolean isCachedMemory() { return false; diff --git a/libjava/classpath/javax/imageio/stream/FileCacheImageOutputStream.java b/libjava/classpath/javax/imageio/stream/FileCacheImageOutputStream.java index 47b7bb85ace..1d73a05e5fc 100644 --- a/libjava/classpath/javax/imageio/stream/FileCacheImageOutputStream.java +++ b/libjava/classpath/javax/imageio/stream/FileCacheImageOutputStream.java @@ -84,12 +84,12 @@ public class FileCacheImageOutputStream extends ImageOutputStreamImpl { return true; } - + public boolean isCachedMemory() { return false; } - + public int read() throws IOException { diff --git a/libjava/classpath/javax/imageio/stream/FileImageInputStream.java b/libjava/classpath/javax/imageio/stream/FileImageInputStream.java index 4fa1ac8a3dc..abdd997ba0a 100644 --- a/libjava/classpath/javax/imageio/stream/FileImageInputStream.java +++ b/libjava/classpath/javax/imageio/stream/FileImageInputStream.java @@ -49,7 +49,7 @@ import java.io.RandomAccessFile; public class FileImageInputStream extends ImageInputStreamImpl { private RandomAccessFile file; - + public FileImageInputStream(File file) throws FileNotFoundException, IOException { diff --git a/libjava/classpath/javax/imageio/stream/FileImageOutputStream.java b/libjava/classpath/javax/imageio/stream/FileImageOutputStream.java index e1ce5c25eec..7d5d8fbe033 100644 --- a/libjava/classpath/javax/imageio/stream/FileImageOutputStream.java +++ b/libjava/classpath/javax/imageio/stream/FileImageOutputStream.java @@ -49,7 +49,7 @@ import java.io.RandomAccessFile; public class FileImageOutputStream extends ImageOutputStreamImpl { private RandomAccessFile file; - + public FileImageOutputStream(File file) throws FileNotFoundException, IOException { @@ -92,7 +92,7 @@ public class FileImageOutputStream extends ImageOutputStreamImpl throws IOException { checkClosed(); - + setBitOffset(0); return file.read(); } @@ -101,7 +101,7 @@ public class FileImageOutputStream extends ImageOutputStreamImpl throws IOException { checkClosed(); - + setBitOffset(0); return file.read(data, offset, len); } @@ -117,7 +117,7 @@ public class FileImageOutputStream extends ImageOutputStreamImpl throws IOException { checkClosed(); - + flushBits(); file.write(data, offset, len); } @@ -126,7 +126,7 @@ public class FileImageOutputStream extends ImageOutputStreamImpl throws IOException { checkClosed(); - + // FIXME: Flush pending bits. file.write(value); } diff --git a/libjava/classpath/javax/imageio/stream/ImageInputStream.java b/libjava/classpath/javax/imageio/stream/ImageInputStream.java index 4d1b5d57aa5..dd57ca611da 100644 --- a/libjava/classpath/javax/imageio/stream/ImageInputStream.java +++ b/libjava/classpath/javax/imageio/stream/ImageInputStream.java @@ -58,7 +58,7 @@ public interface ImageInputStream void setByteOrder(ByteOrder order); ByteOrder getByteOrder(); - + int read() throws IOException; @@ -156,7 +156,7 @@ public interface ImageInputStream * * <p>The {@linkplain #getBitOffset() bit offset} is set to zero * before any data is read. - * + * * @throws EOFException if the input stream ends before all two * bytes were read. * @@ -178,7 +178,7 @@ public interface ImageInputStream * * <p>The {@linkplain #getBitOffset() bit offset} is set to zero * before any data is read. - * + * * <p>This method does the same as {@link #readChar()}. * * @throws EOFException if the input stream ends before all two @@ -202,7 +202,7 @@ public interface ImageInputStream * * <p>The {@linkplain #getBitOffset() bit offset} is set to zero * before any data is read. - * + * * <p>This method does the same as {@link #readUnsignedShort()}. * * @throws EOFException if the input stream ends before all two @@ -224,7 +224,7 @@ public interface ImageInputStream * * <p>The {@linkplain #getBitOffset() bit offset} is set to zero * before any data is read. - * + * * @throws EOFException if the input stream ends before all four * bytes were read. * @@ -245,7 +245,7 @@ public interface ImageInputStream * * <p>The {@linkplain #getBitOffset() bit offset} is set to zero * before any data is read. - * + * * @throws EOFException if the input stream ends before all four * bytes were read. * @@ -266,7 +266,7 @@ public interface ImageInputStream * * <p>The {@linkplain #getBitOffset() bit offset} is set to zero * before any data is read. - * + * * @throws EOFException if the input stream ends before all eight * bytes were read. * @@ -286,7 +286,7 @@ public interface ImageInputStream * * <p>The {@linkplain #getBitOffset() bit offset} is set to zero * before any data is read. - * + * * @throws EOFException if the input stream ends before all four * bytes were read. * @@ -306,7 +306,7 @@ public interface ImageInputStream * * <p>The {@linkplain #getBitOffset() bit offset} is set to zero * before any data is read. - * + * * @throws EOFException if the input stream ends before all eight * bytes were read. * @@ -331,7 +331,7 @@ public interface ImageInputStream * * <p>The {@linkplain #getBitOffset() bit offset} is set to zero * before any data is read. - * + * * @param b an array for storing the read values. * * @param offset the index of the first element in <code>b</code> @@ -364,7 +364,7 @@ public interface ImageInputStream * * <p>The {@linkplain #getBitOffset() bit offset} is set to zero * before any data is read. - * + * * @param b an array for storing the read values. * * @throws NullPointerException if <code>b</code> is @@ -391,7 +391,7 @@ public interface ImageInputStream * * <p>The {@linkplain #getBitOffset() bit offset} is set to zero * before any data is read. - * + * * @param s an array for storing the read values. * * @param offset the index of the first element in <code>s</code> @@ -427,7 +427,7 @@ public interface ImageInputStream * * <p>The {@linkplain #getBitOffset() bit offset} is set to zero * before any data is read. - * + * * @param c an array for storing the read values. * * @param offset the index of the first element in <code>c</code> @@ -463,7 +463,7 @@ public interface ImageInputStream * * <p>The {@linkplain #getBitOffset() bit offset} is set to zero * before any data is read. - * + * * @param i an array for storing the read values. * * @param offset the index of the first element in <code>i</code> @@ -499,7 +499,7 @@ public interface ImageInputStream * * <p>The {@linkplain #getBitOffset() bit offset} is set to zero * before any data is read. - * + * * @param l an array for storing the read values. * * @param offset the index of the first element in <code>l</code> @@ -535,7 +535,7 @@ public interface ImageInputStream * * <p>The {@linkplain #getBitOffset() bit offset} is set to zero * before any data is read. - * + * * @param d an array for storing the read values. * * @param offset the index of the first element in <code>d</code> @@ -572,7 +572,7 @@ public interface ImageInputStream * * <p>The {@linkplain #getBitOffset() bit offset} is set to zero * before any data is read. - * + * * @param d an array for storing the read values. * * @param offset the index of the first element in <code>d</code> diff --git a/libjava/classpath/javax/imageio/stream/ImageInputStreamImpl.java b/libjava/classpath/javax/imageio/stream/ImageInputStreamImpl.java index e338f1dbe3d..72fd6de483c 100644 --- a/libjava/classpath/javax/imageio/stream/ImageInputStreamImpl.java +++ b/libjava/classpath/javax/imageio/stream/ImageInputStreamImpl.java @@ -53,9 +53,9 @@ public abstract class ImageInputStreamImpl implements ImageInputStream { private boolean closed; private Stack markStack = new Stack(); - + byte[] buffer = new byte[8]; - + protected int bitOffset; protected ByteOrder byteOrder = ByteOrder.BIG_ENDIAN; protected long flushedPos; @@ -79,7 +79,7 @@ public abstract class ImageInputStreamImpl implements ImageInputStream checkClosed(); closed = true; } - + protected void finalize() throws Throwable { @@ -153,7 +153,7 @@ public abstract class ImageInputStreamImpl implements ImageInputStream { try { - markStack.push(new Long(getStreamPosition())); + markStack.push(new Long(getStreamPosition())); } catch (IOException e) { @@ -193,7 +193,7 @@ public abstract class ImageInputStreamImpl implements ImageInputStream seek(getStreamPosition() - 1); data = (byte) (data >> (8 - newOffset)); } - + bitOffset = newOffset; return data & 0x1; } @@ -210,8 +210,8 @@ public abstract class ImageInputStreamImpl implements ImageInputStream for (int i = 0; i < numBits; i++) { - bits <<= 1; - bits |= readBit(); + bits <<= 1; + bits |= readBit(); } return bits; } @@ -351,9 +351,9 @@ public abstract class ImageInputStreamImpl implements ImageInputStream while (!eol) { - switch(c) - { - case '\r': + switch(c) + { + case '\r': // Check for following '\n'. long oldPosition = getStreamPosition(); c = read(); @@ -366,14 +366,14 @@ public abstract class ImageInputStreamImpl implements ImageInputStream } continue; - case '\n': - eol = true; + case '\n': + eol = true; continue; - default: - buffer.append((char) c); - break; - } + default: + buffer.append((char) c); + break; + } c = read(); if (c == -1) eol = true; @@ -454,13 +454,13 @@ public abstract class ImageInputStreamImpl implements ImageInputStream try { - data = DataInputStream.readUTF(this); + data = DataInputStream.readUTF(this); } finally { - setByteOrder(old); + setByteOrder(old); } - + return data; } @@ -468,7 +468,7 @@ public abstract class ImageInputStreamImpl implements ImageInputStream throws IOException { checkClosed(); - + long mark = ((Long) markStack.pop()).longValue(); seek(mark); } @@ -489,7 +489,7 @@ public abstract class ImageInputStreamImpl implements ImageInputStream throws IOException { checkClosed(); - + if (bitOffset < 0 || bitOffset > 7) throw new IllegalArgumentException("bitOffset not between 0 and 7 inclusive"); @@ -505,7 +505,7 @@ public abstract class ImageInputStreamImpl implements ImageInputStream throws IOException { checkClosed(); - + seek(getStreamPosition() + num); bitOffset = 0; return num; @@ -515,7 +515,7 @@ public abstract class ImageInputStreamImpl implements ImageInputStream throws IOException { checkClosed(); - + seek(getStreamPosition() + num); bitOffset = 0; return num; @@ -530,12 +530,12 @@ public abstract class ImageInputStreamImpl implements ImageInputStream while (len > 0) { - // read will block until some data is available. - int numread = read (buf, offset, len); - if (numread < 0) - throw new EOFException (); - len -= numread; - offset += numread; + // read will block until some data is available. + int numread = read (buf, offset, len); + if (numread < 0) + throw new EOFException (); + len -= numread; + offset += numread; } bitOffset = 0; } diff --git a/libjava/classpath/javax/imageio/stream/ImageOutputStreamImpl.java b/libjava/classpath/javax/imageio/stream/ImageOutputStreamImpl.java index f23e695d0b3..5bf7e440221 100644 --- a/libjava/classpath/javax/imageio/stream/ImageOutputStreamImpl.java +++ b/libjava/classpath/javax/imageio/stream/ImageOutputStreamImpl.java @@ -221,20 +221,20 @@ public abstract class ImageOutputStreamImpl extends ImageInputStreamImpl for(int i = 0; i < len; ++len) writeDouble(data[offset + i]); } - + public void writeFloat(float value) throws IOException { writeInt(Float.floatToIntBits(value)); } - + public void writeFloats(float[] data, int offset, int len) throws IOException { for(int i = 0; i < len; ++len) writeFloat(data[offset + i]); } - + public void writeInt(int value) throws IOException { @@ -252,17 +252,17 @@ public abstract class ImageOutputStreamImpl extends ImageInputStreamImpl buffer[2] = ((byte) (value >> 8)); buffer[3] = ((byte) value); } - + write(buffer, 0, 4); } - + public void writeInts(int[] data, int offset, int len) throws IOException { for(int i = 0; i < len; ++len) writeInt(data[offset + i]); } - + public void writeLong(long value) throws IOException { @@ -288,17 +288,17 @@ public abstract class ImageOutputStreamImpl extends ImageInputStreamImpl buffer[6] = ((byte) (value >> 8)); buffer[7] = ((byte) value); } - + write(buffer, 0, 8); } - + public void writeLongs(long[] data, int offset, int len) throws IOException { for(int i = 0; i < len; ++len) writeLong(data[offset + i]); } - + public void writeShort(int value) throws IOException { @@ -312,17 +312,17 @@ public abstract class ImageOutputStreamImpl extends ImageInputStreamImpl buffer[0] = ((byte) (value >> 8)); buffer[1] = ((byte) value); } - + write(buffer, 0, 2); } - + public void writeShorts(short[] data, int offset, int len) throws IOException { for(int i = 0; i < len; ++len) writeShort(data[offset + i]); } - + public void writeUTF(String value) throws IOException { @@ -367,7 +367,7 @@ public abstract class ImageOutputStreamImpl extends ImageInputStreamImpl buf[pos++] = (byte) (0x80 | (0x3f & c)); } } - + writeShort (sum); write(buf, 0, sum); } diff --git a/libjava/classpath/javax/imageio/stream/MemoryCacheImageInputStream.java b/libjava/classpath/javax/imageio/stream/MemoryCacheImageInputStream.java index 72aa5e8d59f..e1ad71f5871 100644 --- a/libjava/classpath/javax/imageio/stream/MemoryCacheImageInputStream.java +++ b/libjava/classpath/javax/imageio/stream/MemoryCacheImageInputStream.java @@ -51,7 +51,7 @@ public class MemoryCacheImageInputStream extends ImageInputStreamImpl private BufferedInputStream buffer; private int READLIMIT = 2048; - + public MemoryCacheImageInputStream(InputStream stream) { this.stream = stream; @@ -85,7 +85,7 @@ public class MemoryCacheImageInputStream extends ImageInputStreamImpl { return false; } - + public boolean isCachedMemory() { return true; @@ -96,7 +96,7 @@ public class MemoryCacheImageInputStream extends ImageInputStreamImpl { setBitOffset(0); int retval = buffer.read(); - + if (retval != -1) streamPos++; @@ -114,9 +114,9 @@ public class MemoryCacheImageInputStream extends ImageInputStreamImpl streamPos += retval; } - return retval; + return retval; } - + public void seek(long position) throws IOException { diff --git a/libjava/classpath/javax/imageio/stream/MemoryCacheImageOutputStream.java b/libjava/classpath/javax/imageio/stream/MemoryCacheImageOutputStream.java index 17039f544e7..84e8360900c 100644 --- a/libjava/classpath/javax/imageio/stream/MemoryCacheImageOutputStream.java +++ b/libjava/classpath/javax/imageio/stream/MemoryCacheImageOutputStream.java @@ -78,7 +78,7 @@ public class MemoryCacheImageOutputStream extends ImageOutputStreamImpl { return false; } - + public boolean isCachedMemory() { return true; |