gzz.mediaserver
Class MediaserverBlock.AbstractBlock

java.lang.Object
  |
  +--gzz.mediaserver.MediaserverBlock.AbstractBlock
All Implemented Interfaces:
MediaserverBlock
Direct Known Subclasses:
MediaserverBlock.ByteArrayBlock, MediaserverBlock.FileBlock
Enclosing class:
MediaserverBlock

public abstract static class MediaserverBlock.AbstractBlock
extends java.lang.Object
implements MediaserverBlock


Nested Class Summary
 
Nested classes inherited from class gzz.mediaserver.MediaserverBlock
MediaserverBlock.AbstractBlock, MediaserverBlock.ByteArrayBlock, MediaserverBlock.FileBlock
 
Constructor Summary
protected MediaserverBlock.AbstractBlock(Mediaserver.Id id, java.lang.String poolName, java.io.InputStream is)
           
 
Method Summary
 byte[] getBytes()
           
 java.lang.String getContentType()
          Get the MIME Content-Type.
 java.util.Map getHeader()
          Get the header as a Map, in the format returned by HeaderUtil.readHeader().
 Mediaserver.Id getId()
          Get the ID of this block.
 java.io.InputStream getInputStream()
          Get an input stream for reading the body of this block.
 java.lang.String getPoolName()
          Get the name of the pool that this block came from.
 byte[] getRaw()
           
 java.lang.String getRawHeader()
          Get the raw header as a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gzz.mediaserver.MediaserverBlock
getRawInputStream
 

Constructor Detail

MediaserverBlock.AbstractBlock

protected MediaserverBlock.AbstractBlock(Mediaserver.Id id,
                                         java.lang.String poolName,
                                         java.io.InputStream is)
                                  throws java.io.IOException
Parameters:
is - An unchecked input stream on the raw data, for reading in the header. An id-checked input stream would throw an exception when closed because we read not the whole block, but just the header.
Method Detail

getId

public Mediaserver.Id getId()
Description copied from interface: MediaserverBlock
Get the ID of this block.

Specified by:
getId in interface MediaserverBlock

getContentType

public java.lang.String getContentType()
Description copied from interface: MediaserverBlock
Get the MIME Content-Type.

Specified by:
getContentType in interface MediaserverBlock

getHeader

public java.util.Map getHeader()
Description copied from interface: MediaserverBlock
Get the header as a Map, in the format returned by HeaderUtil.readHeader().

Specified by:
getHeader in interface MediaserverBlock

getRawHeader

public java.lang.String getRawHeader()
                              throws java.io.IOException
Description copied from interface: MediaserverBlock
Get the raw header as a string.

Specified by:
getRawHeader in interface MediaserverBlock
java.io.IOException

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Description copied from interface: MediaserverBlock
Get an input stream for reading the body of this block.

Specified by:
getInputStream in interface MediaserverBlock
java.io.IOException

getPoolName

public java.lang.String getPoolName()
Description copied from interface: MediaserverBlock
Get the name of the pool that this block came from.

Specified by:
getPoolName in interface MediaserverBlock

getBytes

public byte[] getBytes()
                throws java.io.IOException
Specified by:
getBytes in interface MediaserverBlock
java.io.IOException

getRaw

public byte[] getRaw()
              throws java.io.IOException
Specified by:
getRaw in interface MediaserverBlock
java.io.IOException