Changeset 4285


Ignore:
Timestamp:
08/05/08 08:10:00 (12 years ago)
Author:
melissa
Message:

Added OME-XML writer.

Location:
trunk/loci/formats
Files:
1 added
2 edited

Legend:

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

    r4203 r4285  
    5656      int[] dims, Object options) throws FormatException 
    5757  { 
    58     // TODO: Add compression support. 
    59     throw new FormatException("ZLIB Compression not currently supported"); 
     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(); 
     71    } 
     72    catch (IOException e) { 
     73      throw new FormatException("Error compressing ZLIB image", e); 
     74    }  
    6075  } 
    6176 
  • trunk/loci/formats/writers.txt

    r4163 r4285  
    2424# Please do not edit unless you know what you are doing. 
    2525 
     26loci.formats.out.OMEXMLWriter   # ome 
    2627loci.formats.out.OMETiffWriter # ome.tif, ome.tiff 
    2728loci.formats.out.TiffWriter # tif, tiff 
Note: See TracChangeset for help on using the changeset viewer.