com.tuneology.avm.media
Class MediaFile

java.lang.Object
  |
  +--java.io.RandomAccessFile
        |
        +--com.tuneology.avm.media.MediaFile
All Implemented Interfaces:
java.io.DataInput, java.io.DataOutput, MediaData

public class MediaFile
extends java.io.RandomAccessFile
implements MediaData

This class implements a file API suitable for media files.

Version:
$Id: MediaFile.java,v 1.2 2003/03/19 02:26:07 xnarf Exp $
Author:
Fran Taylor

Constructor Summary
MediaFile(java.io.File f, java.lang.String m)
           
MediaFile(java.lang.String n, java.lang.String m)
           
 
Method Summary
 boolean canSeek()
          Returns true if the file is capable of seeking.
 java.io.File getFile()
          Returns a File object by which the contents can be read.
 java.lang.String getPath()
          Returns the pathname of the file if it has one, blank otherwise.
 MediaProperties getProperties()
           
 boolean isStream()
          Returns true if the source is a stream of indefinate length.
 void releaseFile(java.io.File f)
          Deletes the contents of the file if it's a temp file.
 
Methods inherited from class java.io.RandomAccessFile
close, getFD, getFilePointer, length, read, read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, seek, setLength, skipBytes, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.tuneology.avm.media.MediaData
close, getFilePointer, length, read, seek, setLength, write
 

Constructor Detail

MediaFile

public MediaFile(java.io.File f,
                 java.lang.String m)
          throws java.io.FileNotFoundException
Parameters:
f - the file object
m - the access mode
See Also:
RandomAccessFile.RandomAccessFile(File, String)

MediaFile

public MediaFile(java.lang.String n,
                 java.lang.String m)
          throws java.io.FileNotFoundException
Parameters:
n - the filename
m - the access mode
See Also:
RandomAccessFile.RandomAccessFile(String, String)
Method Detail

getFile

public java.io.File getFile()
                     throws java.io.IOException
Description copied from interface: MediaData
Returns a File object by which the contents can be read. This can be a temporary file, if necessary. Not allowed if the source is a stream.
Specified by:
getFile in interface MediaData
Throws:
java.io.IOException -  

getPath

public java.lang.String getPath()
Description copied from interface: MediaData
Returns the pathname of the file if it has one, blank otherwise.
Specified by:
getPath in interface MediaData
Following copied from interface: com.tuneology.avm.media.MediaData
Returns:
the pathname of the file if it has one, blank otherwise.

getProperties

public MediaProperties getProperties()
Specified by:
getProperties in interface MediaData

releaseFile

public void releaseFile(java.io.File f)
                 throws java.io.IOException
Description copied from interface: MediaData
Deletes the contents of the file if it's a temp file.
Specified by:
releaseFile in interface MediaData
Throws:
java.io.IOException -  

isStream

public boolean isStream()
Returns true if the source is a stream of indefinate length.
Specified by:
isStream in interface MediaData
Returns:
true if the source is a stream of indefinate length.

canSeek

public boolean canSeek()
Returns true if the file is capable of seeking.
Specified by:
canSeek in interface MediaData