sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1753844 - in /sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff: GeoTIFF.java GeoTiffStore.java ImageFileDirectory.java Reader.java Tags.java Types.java
Date Fri, 22 Jul 2016 22:45:26 GMT
Author: desruisseaux
Date: Fri Jul 22 22:45:26 2016
New Revision: 1753844

URL: http://svn.apache.org/viewvc?rev=1753844&view=rev
Log:
Continue port of GeoTIFF reader.

Added:
    sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Tags.java
  (with props)
    sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Types.java
  (with props)
Modified:
    sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTIFF.java
    sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStore.java
    sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/ImageFileDirectory.java
    sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Reader.java

Modified: sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTIFF.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTIFF.java?rev=1753844&r1=1753843&r2=1753844&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTIFF.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTIFF.java
[UTF-8] Fri Jul 22 22:45:26 2016
@@ -16,6 +16,7 @@
  */
 package org.apache.sis.storage.geotiff;
 
+import java.util.Locale;
 import java.io.Closeable;
 
 
@@ -32,8 +33,14 @@ import java.io.Closeable;
  */
 abstract class GeoTIFF implements Closeable {
     /**
+     * The locale for formatting error messages.
+     */
+    final Locale locale;
+
+    /**
      * For subclass constructors.
      */
-    GeoTIFF() {
+    GeoTIFF(final Locale locale) {
+        this.locale = locale;
     }
 }

Modified: sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStore.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStore.java?rev=1753844&r1=1753843&r2=1753844&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStore.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStore.java
[UTF-8] Fri Jul 22 22:45:26 2016
@@ -59,7 +59,7 @@ public class GeoTiffStore extends DataSt
         }
         storage.closeAllExcept(input);
         try {
-            reader = new Reader(input);
+            reader = new Reader(input, super.getLocale());
         } catch (IOException e) {
             throw new DataStoreException(e);
         }
@@ -84,7 +84,7 @@ public class GeoTiffStore extends DataSt
      * @throws DataStoreException if an error occurred while closing the GeoTIFF file.
      */
     @Override
-    public void close() throws DataStoreException {
+    public synchronized void close() throws DataStoreException {
         final Reader r = reader;
         reader = null;
         if (r != null) try {

Modified: sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/ImageFileDirectory.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/ImageFileDirectory.java?rev=1753844&r1=1753843&r2=1753844&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/ImageFileDirectory.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/ImageFileDirectory.java
[UTF-8] Fri Jul 22 22:45:26 2016
@@ -16,8 +16,6 @@
  */
 package org.apache.sis.storage.geotiff;
 
-import java.io.IOException;
-
 
 /**
  * An Image File Directory (FID) in a TIFF image.
@@ -32,19 +30,21 @@ import java.io.IOException;
  */
 final class ImageFileDirectory {
     /**
-     * The offset (in bytes) of the Image File Directory (FID).
+     * The offset (in bytes since the beginning of the TIFF stream) of the Image File Directory
(FID).
      * The directory may be at any location in the file after the header.
      * In particular, an Image File Directory may follow the image that it describes.
      */
     final long offset;
 
     /**
-     * The size of the image described by this FID.
+     * The size of the image described by this FID, or 0 if the information has not been
found.
+     * Should be interpreted as an unsigned value.
      */
     private int imageWidth, imageHeight;
 
     /**
-     * The size of each tile.
+     * The size of each tile, or 0 if the information has not be found.
+     * Should be interpreted as an unsigned value.
      */
     private int tileWidth, tileHeight;
 
@@ -53,7 +53,11 @@ final class ImageFileDirectory {
     /**
      * Creates a new image file directory located at the given offset (in bytes) in the TIFF
file.
      */
-    ImageFileDirectory(final Reader reader, long offset) throws IOException {
+    ImageFileDirectory(final long offset) {
         this.offset = offset;
     }
+
+    void addEntry(final int tag, final int type, final long value) {
+        // TODO
+    }
 }

Modified: sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Reader.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Reader.java?rev=1753844&r1=1753843&r2=1753844&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Reader.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Reader.java
[UTF-8] Fri Jul 22 22:45:26 2016
@@ -18,6 +18,8 @@ package org.apache.sis.storage.geotiff;
 
 import java.util.List;
 import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Locale;
 import java.io.IOException;
 import java.nio.ByteOrder;
 import org.apache.sis.internal.storage.ChannelDataInput;
@@ -56,9 +58,20 @@ final class Reader extends GeoTIFF {
     private final long origin;
 
     /**
-     * {@code true} if the file uses the BigTIFF format, or (@code false} for standard TIFF.
+     * A multiplication factor for the size of pointers, expressed as a power of 2.
+     * The pointer size in bytes is given by {@code Integer.BYTES << pointerExpansion}.
+     *
+     * <p>Values can be:</p>
+     * <ul>
+     *   <li>0 for the classical TIFF format, which uses 4 bytes.</li>
+     *   <li>1 for the BigTIFF format, which uses 8 bytes.</li>
+     *   <li>2 for 16 bytes (not yet used, but the BigTIFF specification makes provision
for it).
+     * </ul>
+     *
+     * Those values are defined that way for making easier (like a boolean flag) to test
if
+     * the file is a BigTIFF format, with statement like {@code if (intSizeExpansion != 0)}.
      */
-    private final boolean isBigTIFF;
+    private final byte intSizeExpansion;
 
     /**
      * Positions of each <cite>Image File Directory</cite> (IFD) in this file.
Those positions are fetched
@@ -73,7 +86,8 @@ final class Reader extends GeoTIFF {
      * @throws IOException if an error occurred while reading bytes from the stream.
      * @throws DataStoreException if the file is not encoded in the TIFF or BigTIFF format.
      */
-    Reader(final ChannelDataInput input) throws IOException, DataStoreException {
+    Reader(final ChannelDataInput input, final Locale locale) throws IOException, DataStoreException
{
+        super(locale);
         this.input = input;
         origin = input.getStreamPosition();
         /*
@@ -93,16 +107,37 @@ final class Reader extends GeoTIFF {
              * Currently, that pointer type canonly be the Java Long type (8 bytes),
              * but a future BigTIFF version may allow 16 bytes wide pointers.
              */
-            final short magicNumber = input.readShort();
-            if (isBigTIFF = (magicNumber == 43)) {
-                if (input.readShort() == Long.BYTES && input.readShort() == 0) {
+            switch (input.readShort()) {
+                case 42: {                                          // Magic number of classical
format.
+                    intSizeExpansion = 0;
                     return;
                 }
-            } else if (magicNumber == 42) {
-                return;
+                case 43: {                                          // Magic number of BigTIFF
format.
+                    final int numBits  = input.readUnsignedShort();
+                    final int powerOf2 = Integer.numberOfTrailingZeros(numBits);    // In
the [0 … 32] range.
+                    if (numBits == (1L << powerOf2) && input.readShort() ==
0) {
+                        intSizeExpansion = (byte) (powerOf2 - 2);
+                        if (intSizeExpansion == 1) {
+                            /*
+                             * Above 'intSizeExpension' calculation was a little bit useless
since we accept only
+                             * one result in the end, but we did that generic computation
anyway for keeping the
+                             * code almost ready if the BigTIFF specification adds support
for 16 bytes pointer.
+                             */
+                            return;
+                        }
+                    }
+                }
             }
         }
-        throw new DataStoreException(Errors.format(Errors.Keys.UnexpectedFileFormat_2, "TIFF",
input.filename));
+        throw new DataStoreException(Errors.getResources(locale).getString(
+                Errors.Keys.UnexpectedFileFormat_2, "TIFF", input.filename));
+    }
+
+    /**
+     * Returns a default message for parsing error.
+     */
+    private String canNotRead() {
+        return Errors.getResources(locale).getString(Errors.Keys.CanNotParseFile_2, "TIFF",
input.filename);
     }
 
     /**
@@ -111,8 +146,15 @@ final class Reader extends GeoTIFF {
      *
      * @return The next pointer value.
      */
-    private long readPointer() throws IOException {
-        return isBigTIFF ? input.readLong() : input.readUnsignedInt();
+    private long readUnsignedInt() throws IOException, DataStoreException {
+        if (intSizeExpansion == 0) {
+            return input.readUnsignedInt();         // Classical format.
+        }
+        final long pointer = input.readLong();      // BigTIFF format.
+        if (pointer >= 0) {
+            return pointer;
+        }
+        throw new DataStoreException(canNotRead());
     }
 
     /**
@@ -121,23 +163,66 @@ final class Reader extends GeoTIFF {
      *
      * @return The next directory entry value.
      */
-    final long readDirectoryEntry() throws IOException {
-        return isBigTIFF ? input.readLong() : input.readUnsignedShort();
+    private long readUnsignedShort() throws IOException, DataStoreException {
+        if (intSizeExpansion == 0) {
+            return input.readUnsignedShort();       // Classical format.
+        }
+        final long entry = input.readLong();        // BigTIFF format.
+        if (entry >= 0) {
+            return entry;
+        }
+        throw new DataStoreException(canNotRead());
     }
 
     /**
-     * Reads the next bytes in the {@linkplain #input}, which must be the 32 or 64 bits offset
to the
-     * next <cite>Image File Directory</cite> (IFD).
+     * Reads the next bytes in the {@linkplain #input}, which must be the 32 or 64 bits
+     * offset to the next <cite>Image File Directory</cite> (IFD), then parses
that IFD.
+     * The IFD consists of a 2 (classical) or 8 (BigTiff)-bytes count of the number of
+     * directory entries, followed by a sequence of 12-byte field entries, followed by
+     * a pointer to the next IFD (or 0 if none).
+     *
+     * <p>The parsed entry is added to the {@link #imageFileDirectories} list.</p>
      *
      * @return {@code true} if we found a new IFD, or {@code false} if there is no more
IFD.
+     * @throws ArithmeticException if the pointer to the next IFD is too far.
      */
-    private boolean readImageFileDirectory() throws IOException {
-        final long offset = readPointer();
+    private boolean nextImageFileDirectory() throws IOException, DataStoreException {
+        final long offset = readUnsignedInt();
         if (offset == 0) {
             return false;
         }
-        input.seek(offset);
-        return imageFileDirectories.add(new ImageFileDirectory(this, offset));
+        /*
+         * Design note: we parse the Image File Directory entry now because even if we were
+         * not interrested in that IFD, we need to go anyway after its last record in order
+         * to get the pointer to the next IFD.
+         */
+        input.seek(Math.addExact(origin, offset));
+        final int offsetSize = Integer.BYTES << intSizeExpansion;
+        final ImageFileDirectory dir = new ImageFileDirectory(offset);
+        final Collection<long[]> deferred = new ArrayList<>(4);
+        for (long remaining = readUnsignedShort(); --remaining >= 0;) {
+            /*
+             * Each entry in the Image File Directory has the following format:
+             *   - The tag that identifies the field (see constants in the Tags class).
+             *   - The field type (see constants inherited from the GeoTIFF class).
+             *   - The number of values of the indicated type.
+             *   - The value, or the file offset to the value elswhere in the file.
+             */
+            final int   tag   = input.readUnsignedShort();
+            final short type  = input.readShort();
+            final long  count = readUnsignedInt();
+            final long  size  = Math.multiplyExact(Types.size(type), count);
+            final long  value = readUnsignedInt();
+            if (size <= offsetSize) {
+                // offset is the real value(s).
+                dir.addEntry(tag, type, value);
+            } else {
+                // offset from beginning of file where the values are stored.
+                deferred.add(new long[] {tag, type, count, value});
+            }
+        }
+        // TODO: process deferred data.
+        return imageFileDirectories.add(dir);
     }
 
     /**

Added: sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Tags.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Tags.java?rev=1753844&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Tags.java
(added)
+++ sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Tags.java
[UTF-8] Fri Jul 22 22:45:26 2016
@@ -0,0 +1,129 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.storage.geotiff;
+
+
+/**
+ * Numerical values of GeoTIFF tags. In this class, field names are identical to TIFF tag
names.
+ * For that reason, many of those field names do not follow usual Java convention for constants.
+ *
+ * <p>A useful (but unofficial) reference is the
+ * <a href="http://www.awaresystems.be/imaging/tiff/tifftags.html">TIFF Tag Reference</a>
page.
+ *
+ * @author  Johann Sorel (Geomatys)
+ * @since   0.8
+ * @version 0.8
+ * @module
+ */
+final class Tags {
+
+    //////////////////////////////////////////////////////////
+    //                  BASELINE TIFF TAGS                  //
+    //////////////////////////////////////////////////////////
+
+    static final int NewSubfileType              = 0x00FE;
+    static final int SubfileType                 = 0x00FF;
+    static final int ImageWidth                  = 0x0100;
+    static final int ImageLength                 = 0x0101;
+    static final int BitsPerSample               = 0x0102;
+    static final int Compression                 = 0x0103;
+    static final int PhotometricInterpretation   = 0x0106;
+    static final int Threshholding               = 0x0107;
+    static final int CellWidth                   = 0x0108;
+    static final int CellLength                  = 0x0109;
+    static final int FillOrder                   = 0x010A;
+    static final int DocumentName                = 0x010D;
+    static final int ImageDescription            = 0x010E;
+    static final int Make                        = 0x010F;
+    static final int Model                       = 0x0110;
+    static final int StripOffsets                = 0x0111;
+    static final int Orientation                 = 0x0112;
+    static final int SamplesPerPixel             = 0x0115;
+    static final int RowsPerStrip                = 0x0116;
+    static final int StripByteCounts             = 0x0117;
+    static final int MinSampleValue              = 0x0118;
+    static final int MaxSampleValue              = 0x0119;
+    static final int XResolution                 = 0x011A;
+    static final int YResolution                 = 0x011B;
+    static final int PlanarConfiguration         = 0x011C;
+    static final int PageName                    = 0x011D;
+    static final int XPosition                   = 0x011E;
+    static final int YPosition                   = 0x011F;
+    static final int FreeOffsets                 = 0x0120;
+    static final int FreeByteCounts              = 0x0121;
+    static final int GrayResponseUnit            = 0x0122;
+    static final int GrayResponseCurve           = 0x0123;
+    static final int T4Options                   = 0x0124;
+    static final int T6Options                   = 0x0125;
+    static final int ResolutionUnit              = 0x0128;
+    static final int PageNumber                  = 0x0129;
+    static final int TransferFunction            = 0x012D;
+    static final int Software                    = 0x0131;
+    static final int DateTime                    = 0x0132;
+    static final int DateTimeOriginal            = 0x9003;
+    static final int DateTimeDigitized           = 0x9004;
+    static final int Artist                      = 0x013B;
+    static final int HostComputer                = 0x013C;
+    static final int Predictor                   = 0x013D;
+    static final int WhitePoint                  = 0x013E;
+    static final int PrimaryChromaticities       = 0x013F;
+    static final int ColorMap                    = 0x0140;
+    static final int HalftoneHints               = 0x0141;
+    static final int TileWidth                   = 0x0142;
+    static final int TileLength                  = 0x0143;
+    static final int TileOffsets                 = 0x0144;
+    static final int TileByteCounts              = 0x0145;
+    static final int InkSet                      = 0x014C;
+    static final int InkNames                    = 0x014D;
+    static final int NumberOfInks                = 0x014E;
+    static final int DotRange                    = 0x0150;
+    static final int TargetPrinter               = 0x0151;
+    static final int ExtraSamples                = 0x0152;
+    static final int SampleFormat                = 0x0153;
+    static final int SMinSampleValue             = 0x0154;
+    static final int SMaxSampleValue             = 0x0155;
+    static final int TransferRange               = 0x0156;
+    static final int JPEGProc                    = 0x0200;
+    static final int JPEGInterchangeFormat       = 0x0201;
+    static final int JPEGInterchangeFormatLength = 0x0202;
+    static final int JPEGRestartInterval         = 0x0203;
+    static final int JPEGLosslessPredictors      = 0x0205;
+    static final int JPEGPointTransforms         = 0x0206;
+    static final int JPEGQTables                 = 0x0207;
+    static final int JPEGDCTables                = 0x0208;
+    static final int JPEGACTables                = 0x0209;
+    static final int YCbCrCoefficients           = 0x0211;
+    static final int YCbCrSubSampling            = 0x0212;
+    static final int YCbCrPositioning            = 0x0213;
+    static final int ReferenceBlackWhite         = 0x0214;
+    static final int Copyright                   = 0x8298;
+
+
+
+    /////////////////////////////////////////////////////////
+    //                 GDAL EXTENSION TAGS                 //
+    /////////////////////////////////////////////////////////
+
+    static final int GDAL_METADATA = 42112;  // http://www.awaresystems.be/imaging/tiff/tifftags/gdal_metadata.html
+    static final int GDAL_NODATA   = 42113;  // http://www.awaresystems.be/imaging/tiff/tifftags/gdal_nodata.html
+
+    /**
+     * Do not allow instantiation of this class.
+     */
+    private Tags() {
+    }
+}

Propchange: sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Tags.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Tags.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8

Added: sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Types.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Types.java?rev=1753844&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Types.java
(added)
+++ sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Types.java
[UTF-8] Fri Jul 22 22:45:26 2016
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.storage.geotiff;
+
+
+/**
+ * The numerical values of TIFF types.
+ *
+ * @since   0.8
+ * @version 0.8
+ * @module
+ */
+final class Types {
+    /**
+     * Types defined by the TIFF specification or one of its extensions.
+     */
+    static final short UBYTE     = 1,
+                       ASCII     = 2,
+                       USHORT    = 3,
+                       UINT      = 4,
+                       URATIONAL = 5,      // unsigned Integer / unsigned Integer
+                       BYTE      = 6,
+                                           // type 7 is undefined
+                       SHORT     = 8,
+                       INT       = 9,
+                       RATIONAL  = 10,     // signed Integer / signed Integer
+                       FLOAT     = 11,
+                       DOUBLE    = 12,
+                       IFD       = 13,     // IFD is like UINT.
+                       ULONG     = 16,
+                       LONG      = 17,
+                       IFD8      = 18;     // IFD is like ULONG.
+
+    /**
+     * The size of each type in bytes, or 0 if unknown.
+     */
+    private static final byte[] SIZE = new byte[19];
+    static {
+        final byte[] s = SIZE;
+        s[ASCII]                      =   Byte.BYTES;
+        s[BYTE]      =  s[UBYTE]      =   Byte.BYTES;
+        s[SHORT]     =  s[USHORT]     =   Short.BYTES;
+        s[INT]       =  s[UINT]       =   Integer.BYTES;
+        s[LONG]      =  s[ULONG]      =   Long.BYTES;
+        s[RATIONAL]  =  s[URATIONAL]  = 2*Integer.BYTES;
+        s[IFD]                        =   Integer.BYTES;
+        s[IFD8]                       =   Long.BYTES;
+        s[FLOAT]                      =   Float.BYTES;
+        s[DOUBLE]                     =   Double.BYTES;
+    }
+
+    /**
+     * Do not allow instantiation of this class.
+     */
+    private Types() {
+    }
+
+    /**
+     * Returns the size in bytes of the given type.
+     */
+    static int size(final short type) {
+        return SIZE[type] & 0xFF;
+    }
+}

Propchange: sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Types.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Types.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8



Mime
View raw message