Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.modama.jaiutil.codecs.XDR
Class XDRCodec  view XDRCodec download XDRCodec.java

java.lang.Object
  extended byImageCodec
      extended byorg.modama.jaiutil.codecs.XDR.XDRCodec

public final class XDRCodec
extends ImageCodec

A subclass of ImageCodec that handles the XDR Beamline Fileformat


Constructor Summary
XDRCodec()
          Constructs an instance of XDRCodec.
 
Method Summary
 boolean canEncodeImage(java.awt.image.RenderedImage im, ImageEncodeParam param)
          Returns true if the image is encodable by this codec.
protected  ImageDecoder createImageDecoder(java.io.InputStream src, ImageDecodeParam param)
          Instantiates a XDRImageDecoder to read from the given InputStream.
protected  ImageEncoder createImageEncoder(java.io.OutputStream dst, ImageEncodeParam param)
          NOT IMPLEMENTED YET
 java.lang.Class getDecodeParamClass()
          Returns Object.class since no DecodeParam object is required for decoding.
 java.lang.Class getEncodeParamClass()
          Returns null since no encoder exists.
 java.lang.String getFormatName()
          Returns the name of the format handled by this codec.
 int getNumHeaderBytes()
          Returns the number of bytes from the beginning of the data required to recognize it as being in XDR format.
 boolean isFormatRecognized(byte[] header)
          Returns true if the header bytes indicate XDR format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XDRCodec

public XDRCodec()
Constructs an instance of XDRCodec.

Method Detail

getFormatName

public java.lang.String getFormatName()
Returns the name of the format handled by this codec.


getEncodeParamClass

public java.lang.Class getEncodeParamClass()
Returns null since no encoder exists.


getDecodeParamClass

public java.lang.Class getDecodeParamClass()
Returns Object.class since no DecodeParam object is required for decoding.


canEncodeImage

public boolean canEncodeImage(java.awt.image.RenderedImage im,
                              ImageEncodeParam param)
Returns true if the image is encodable by this codec.


createImageEncoder

protected ImageEncoder createImageEncoder(java.io.OutputStream dst,
                                          ImageEncodeParam param)
NOT IMPLEMENTED YET


createImageDecoder

protected ImageDecoder createImageDecoder(java.io.InputStream src,
                                          ImageDecodeParam param)
Instantiates a XDRImageDecoder to read from the given InputStream.

By overriding this method, GQECodec is able to ensure that a ForwardSeekableStream is used to wrap the source InputStream instead of the a general (and more expensive) subclass of SeekableStream. Since the XDR decoder does not require the ability to seek backwards in its input, this allows for greater efficiency.


getNumHeaderBytes

public int getNumHeaderBytes()
Returns the number of bytes from the beginning of the data required to recognize it as being in XDR format.


isFormatRecognized

public boolean isFormatRecognized(byte[] header)
Returns true if the header bytes indicate XDR format.