|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jaudiotagger.audio.asf.io.AsfStreamer
public class AsfStreamer
This class creates a modified copy of an ASF file.
Constructor Summary | |
---|---|
AsfStreamer()
|
Method Summary | |
---|---|
private void |
copyChunk(GUID guid,
java.io.InputStream source,
java.io.OutputStream destination)
Simply copies a chunk from source to
destination .The method assumes, that the GUID has already been read and will write the provided one to the destination. The chunk length however will be read and used to determine the amount of bytes to copy. |
void |
createModifiedCopy(java.io.InputStream source,
java.io.OutputStream dest,
java.util.List<ChunkModifier> modifiers)
Reads the source and applies the modifications provided by
the given modifiers , and puts it to dest .Each modifier is used only once, so if one should be used multiple times, it should be added multiple times into the list. |
private void |
modifyFileHeader(java.io.InputStream source,
java.io.OutputStream destination,
long fileSizeDiff)
This is a slight variation of copyChunk(GUID, InputStream, OutputStream) , it only handles file
property chunks correctly.The copied chunk will have the file size field modified by the given fileSizeDiff value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AsfStreamer()
Method Detail |
---|
private void copyChunk(GUID guid, java.io.InputStream source, java.io.OutputStream destination) throws java.io.IOException
source
to
destination
.
guid
- GUID of the current chunk.source
- source of an ASF chunk, which is to be located at the chunk
length field.destination
- the destination to copy the chunk to.
java.io.IOException
- on I/O errors.public void createModifiedCopy(java.io.InputStream source, java.io.OutputStream dest, java.util.List<ChunkModifier> modifiers) throws java.io.IOException
source
and applies the modifications provided by
the given modifiers
, and puts it to dest
.
source
- the source ASF filedest
- the destination to write the modified version to.modifiers
- list of chunk modifiers to apply.
java.io.IOException
- on I/O errors.private void modifyFileHeader(java.io.InputStream source, java.io.OutputStream destination, long fileSizeDiff) throws java.io.IOException
copyChunk(GUID, InputStream, OutputStream)
, it only handles file
property chunks correctly.fileSizeDiff
value.
source
- source of file properties chunk, located at its chunk length
field.destination
- the destination to copy the chunk to.fileSizeDiff
- the difference which should be applied. (negative values would
subtract the stored file size)
java.io.IOException
- on I/O errors.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |