fang2.media
Class RawMediaCache
java.lang.Object
java.lang.Thread
fang2.media.RawMediaCache
- All Implemented Interfaces:
- Runnable
public class RawMediaCache
- extends Thread
This class facilitates loading and caching
content from a URL off the main execution
thread. Since the FANG Engine advanceFrame
must happen quickly (about 1/25th of a second),
media must be either loaded off the main
execution thread or delay the game. This class
loads and stores the exact contents of the URL
which is usually in compressed format, and has
options for loading off and on the main
execution thread.
- Author:
- jam
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
load
public static void load(URL url)
loadAndWait
public static byte[] loadAndWait(URL url)
load
public static void load(URL url,
RawMediaCache.MediaLoadListener listener)
isCurrentlyLoading
public static boolean isCurrentlyLoading(URL url)
isFullyLoaded
public static boolean isFullyLoaded(URL url)
hasLoadError
public static boolean hasLoadError(URL url)
getCachedStream
public static InputStream getCachedStream(URL url)
run
public void run()
- Description copied from class:
Thread
- If this thread was constructed using a separate
Runnable run object, then that
Runnable object's run method is called;
otherwise, this method does nothing and returns.
Subclasses of Thread should override this method.
- Specified by:
run in interface Runnable- Overrides:
run in class Thread
- See Also:
Thread.start(),
Thread.stop(),
Thread.Thread(java.lang.ThreadGroup,
java.lang.Runnable, java.lang.String),
Runnable.run()
main
public static void main(String[] args)
- Parameters:
args -