jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java
changeset 26743 217c8f2c9cff
parent 25859 3317bb8137f4
child 33257 53772549e154
equal deleted inserted replaced
26742:ff54dcccf417 26743:217c8f2c9cff
   106     private static final int VERSION_5_XP_EMBEDDED = 18;
   106     private static final int VERSION_5_XP_EMBEDDED = 18;
   107 
   107 
   108     // BMP variables
   108     // BMP variables
   109     private long bitmapFileSize;
   109     private long bitmapFileSize;
   110     private long bitmapOffset;
   110     private long bitmapOffset;
       
   111     private long bitmapStart;
   111     private long compression;
   112     private long compression;
   112     private long imageSize;
   113     private long imageSize;
   113     private byte palette[];
   114     private byte palette[];
   114     private int imageType;
   115     private int imageType;
   115     private int numBands;
   116     private int numBands;
   675 
   676 
   676         // Reset to the start of bitmap; then jump to the
   677         // Reset to the start of bitmap; then jump to the
   677         //start of image data
   678         //start of image data
   678         iis.reset();
   679         iis.reset();
   679         iis.skipBytes(bitmapOffset);
   680         iis.skipBytes(bitmapOffset);
       
   681         bitmapStart = iis.getStreamPosition();
       
   682 
   680         gotHeader = true;
   683         gotHeader = true;
   681     }
   684     }
   682 
   685 
   683     public Iterator<ImageTypeSpecifier> getImageTypes(int imageIndex)
   686     public Iterator<ImageTypeSpecifier> getImageTypes(int imageIndex)
   684       throws IOException {
   687       throws IOException {
   810             else if (sampleModel.getDataType() == DataBuffer.TYPE_USHORT)
   813             else if (sampleModel.getDataType() == DataBuffer.TYPE_USHORT)
   811                 sdata = ((DataBufferUShort)raster.getDataBuffer()).getData();
   814                 sdata = ((DataBufferUShort)raster.getDataBuffer()).getData();
   812             else if (sampleModel.getDataType() == DataBuffer.TYPE_INT)
   815             else if (sampleModel.getDataType() == DataBuffer.TYPE_INT)
   813                 idata = ((DataBufferInt)raster.getDataBuffer()).getData();
   816                 idata = ((DataBufferInt)raster.getDataBuffer()).getData();
   814         }
   817         }
       
   818 
       
   819         iis.seek(bitmapStart);
   815 
   820 
   816         // There should only be one tile.
   821         // There should only be one tile.
   817         switch(imageType) {
   822         switch(imageType) {
   818 
   823 
   819         case VERSION_2_1_BIT:
   824         case VERSION_2_1_BIT: