|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectlegacy.resource.Codec
public abstract class Codec
Codec is deigned to handle resource types and the loading of. calls to encode and decode should encode from a native type or decode to a native type. Note native types are a format recognized by legacy and any new implementaion of a type will require adding coding to the legacy and resource management classes.
| Field Summary | |
|---|---|
static java.lang.Object |
FONT_TYPE
Internal reference for a font type |
static java.lang.Object |
IMAGE_TYPE
Internal reference for a image type |
static java.lang.Object |
MIDI_TYPE
Internal reference for a midi type |
static java.lang.Object |
PALLET_TYPE
Internal reference for a pallet type |
static java.lang.Object |
SOUND_TYPE
Internal reference for a sound type |
| Constructor Summary | |
|---|---|
Codec()
|
|
| Method Summary | |
|---|---|
abstract java.io.InputStream |
decodeNative(java.io.InputStream in)
decodeNative returns the native version of the resource from a given inputStream |
abstract void |
encodeNative(java.io.OutputStream out,
java.lang.Class format,
java.lang.Object src)
encodeNative writes to a given output stream from native version of the resource |
abstract java.lang.String |
getExtension()
getExtension returns an extension of a knwon type |
abstract java.lang.Object |
getType()
getType returns the known native type. |
abstract boolean |
isDecodable()
isDecodable check if the ablility to read an input stream is infact possible |
abstract boolean |
isEncodeable()
isEncodable check if the ablility to write an output stream is infact possible |
abstract boolean |
validate(java.lang.String resource)
validate is a method wich is called to check if a resource is actualy associated with this Codec |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.Object IMAGE_TYPE
public static final java.lang.Object PALLET_TYPE
public static final java.lang.Object FONT_TYPE
public static final java.lang.Object MIDI_TYPE
public static final java.lang.Object SOUND_TYPE
| Constructor Detail |
|---|
public Codec()
| Method Detail |
|---|
public abstract boolean validate(java.lang.String resource)
resource - file to test
public abstract boolean isDecodable()
public abstract java.io.InputStream decodeNative(java.io.InputStream in)
throws java.io.IOException
in - input to transcode if needed
java.io.IOException - if an unforseen issue reading a file has occouredpublic abstract boolean isEncodeable()
public abstract void encodeNative(java.io.OutputStream out,
java.lang.Class format,
java.lang.Object src)
throws java.io.IOException
out - the outputformat - the file format to encode fromsrc - the Object it self
java.io.IOException - if an unforseen issue reading a file has occouredpublic abstract java.lang.Object getType()
public abstract java.lang.String getExtension()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||