1 6 7 package org.jboss.media.format; 8 9 import java.io.InputStream ; 10 import java.net.URL ; 11 12 import javax.emb.GenericMediaFormat; 13 import javax.emb.Media; 14 import javax.emb.MediaException; 15 import javax.emb.MediaFormat; 16 import javax.emb.MediaHeader; 17 import javax.emb.MediaSegment; 18 19 27 public abstract class EmbeddedMediaFormat implements MediaFormat 28 { 29 private MediaFormat mediaFormat; 30 31 public EmbeddedMediaFormat() 32 { 33 mediaFormat = new GenericMediaFormat(); 34 } 35 36 public final byte[] assembleContent( 37 URL mediaLocation, 38 MediaSegment[] mediaSegments) 39 throws MediaException 40 { 41 return mediaFormat.assembleContent(mediaLocation, mediaSegments); 42 } 43 44 public final MediaSegment[] disassembleContent( 45 URL mediaLocation, 46 byte[] mediaContent) 47 throws MediaException 48 { 49 return mediaFormat.disassembleContent(mediaLocation, mediaContent); 50 } 51 52 public abstract MediaHeader extractHeader(InputStream content) 53 throws MediaException; 54 55 public Media extractProxy(InputStream content) throws MediaException 56 { 57 return mediaFormat.extractProxy(content); 58 } 59 60 public abstract String getDefaultMimeType(); 61 62 public final boolean isEmbedded() 63 { 64 return true; 65 } 66 67 public abstract boolean isStreamingDesirable(); 68 } 69 | Popular Tags |