Changeset 4287


Ignore:
Timestamp:
08/05/08 08:44:46 (12 years ago)
Author:
melissa
Message:

Fixed compile error.

Location:
trunk/loci/formats
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/codec/ZlibCodec.java

    r4285 r4287  
    2626import java.io.IOException; 
    2727import java.io.PipedInputStream; 
     28import java.io.PipedOutputStream; 
     29import java.util.zip.Deflater; 
    2830import java.util.zip.Inflater; 
    2931import java.util.zip.InflaterInputStream; 
     
    5658      int[] dims, Object options) throws FormatException 
    5759  { 
    58     try { 
    59       Deflater deflater = new Deflater(); 
    60       deflater.setInput(data); 
    61       DeflaterOutputStream out = 
    62         new DeflaterOutputStream(new PipedOutputStream(), deflater); 
    63       byte[] buf = new byte[8192];  
    64      ByteVector bytes = new ByteVector(); 
    65       while (true) { 
    66         int r = out.read(buf, 0, buf.length); 
    67         if (r == -1) break; // eof 
    68         bytes.add(buf, 0, r); 
    69       } 
    70       return bytes.toByteArray(); 
     60    Deflater deflater = new Deflater(); 
     61    deflater.setInput(data); 
     62    deflater.finish(); 
     63    byte[] buf = new byte[8192]; 
     64    ByteVector bytes = new ByteVector(); 
     65    while (true) { 
     66      int r = deflater.deflate(buf, 0, buf.length); 
     67      if (r == -1) break; // eof 
     68      bytes.add(buf, 0, r); 
    7169    } 
    72     catch (IOException e) { 
    73       throw new FormatException("Error compressing ZLIB image", e); 
    74     }  
     70    return bytes.toByteArray(); 
    7571  } 
    7672 
  • trunk/loci/formats/out/OMEXMLWriter.java

    r4286 r4287  
    2929import loci.formats.*; 
    3030import loci.formats.codec.Base64Codec; 
     31import loci.formats.codec.ZlibCodec; 
    3132import loci.formats.meta.MetadataRetrieve; 
    3233import org.xml.sax.Attributes; 
     
    9192 
    9293      if (compression.equals("zlib")) { 
    93         encodedPix = new ZlibCodec().compress(endcodedPix, 0, 0, null, null); 
     94        encodedPix = new ZlibCodec().compress(encodedPix, 0, 0, null, null); 
    9495      } 
    9596 
Note: See TracChangeset for help on using the changeset viewer.