Ignore:
Timestamp:
01/18/07 11:31:28 (13 years ago)
Author:
melissa
Message:

Updated to reflect FileWrapper rename, id mapping API change, and new compression classes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/getting-started.txt

    r2078 r2122  
    106106usually sufficient to override initFile(String) and isThisType(byte[]). 
    107107 
    108 Any time you read a file from disk (e.g., when constructing a file stream), you 
    109 *must* read from the file name returned by FormatHandler.getMappedId(String), 
    110 not the file name passed to the reader.  Thus, a stub for initFile(String) 
    111 might look like this: 
     108 
     109If you read from a file using something other than RandomAccessStream or 
     110Location, you *must* use the file name returned by Location.getMappedId(String), 
     111not the file name passed to the reader. 
     112Thus, a stub for initFile(String) might look like this: 
    112113 
    113114  protected void initFile(String id) throws FormatException, IOException { 
    114115    super.initFile(id); 
    115     RandomAccessStream in = new RandomAccessStream(getMappedId(id)); 
     116     
     117    RandomAccessStream in = new RandomAccessStream(id); 
     118    // alternatively, 
     119    //FileInputStream in = new FileInputStream(Location.getMappedId(id)); 
     120 
    116121    // read basic file structure and metadata from stream 
    117122  } 
    118123 
    119 For more details, see the javadoc for IFormatHandler.mapId(String, String) 
    120 and IFormatHandler.getMappedId(String). 
     124For more details, see the javadoc for Location.mapId(String, String) 
     125and Location.getMappedId(String). 
    121126 
    122127---=== Other useful things ===--- 
     
    127132  It is recommended that you use this for reading binary files. 
    128133 
    129 - loci.formats.FileWrapper extends java.io.File to support reading from URLs. 
    130   It is recommended that you use this instead of File.  See the JavaDoc for 
    131   additional information. 
     134- loci.formats.Location provides an API similar to java.io.File, and supports  
     135  File-like operations on URLs.  It is highly recommended that you use this  
     136  instead of File.  See the javadoc for additional information. 
    132137 
    133138- loci.formats.DataTools provides a number of methods for converting bytes to 
     
    146151  see loci.formats.in.ZeissZVIReader. 
    147152 
    148 - Several common image compression types are supported in 
    149   loci.formats.Compression.  These include LZW, LZO, Base64, ZIP and RLE. 
     153- Several common image compression types are supported through subclasses of 
     154  loci.formats.BaseCompressor.  These include LZW, LZO, Base64, ZIP and  
     155  RLE (PackBits). 
    150156 
    151157- Debugging statements can be added using FormatReader.debug(String). 
Note: See TracChangeset for help on using the changeset viewer.