com.pelzer.util.mp3
Class MP3RetaggingInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by com.pelzer.util.mp3.MP3RetaggingInputStream
All Implemented Interfaces:
Closeable

public class MP3RetaggingInputStream
extends InputStream

This class takes the given file or stream, strips ID3 information from it using MP3AudioOnlyInputStream and then prepends its own replacement metadata to the stream. IF YOU USE THIS CLASS, you must add JID3 to your classpath, as its scope is listed as 'provided'.


Constructor Summary
MP3RetaggingInputStream(File source, byte[] newID3ByteArray)
          Takes the given file, strips it of its existing header and prepends the given byte array.
MP3RetaggingInputStream(File source, MP3Util.Metadata metadata)
          Computes the new header and then calls MP3RetaggingInputStream(InputStream, byte[])
MP3RetaggingInputStream(InputStream in, byte[] newID3ByteArray)
          Takes the given stream, strips it of its existing header and prepends the given byte array.
MP3RetaggingInputStream(InputStream in, MP3Util.Metadata metadata)
          Computes the new header and then calls MP3RetaggingInputStream(InputStream, byte[])
 
Method Summary
 void close()
           
static void main(String[] args)
           
 int read()
           
 
Methods inherited from class java.io.InputStream
available, mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MP3RetaggingInputStream

public MP3RetaggingInputStream(InputStream in,
                               byte[] newID3ByteArray)
                        throws IOException
Takes the given stream, strips it of its existing header and prepends the given byte array.

Throws:
IOException

MP3RetaggingInputStream

public MP3RetaggingInputStream(File source,
                               byte[] newID3ByteArray)
                        throws IOException
Takes the given file, strips it of its existing header and prepends the given byte array.

Throws:
IOException

MP3RetaggingInputStream

public MP3RetaggingInputStream(InputStream in,
                               MP3Util.Metadata metadata)
                        throws org.blinkenlights.jid3.ID3Exception,
                               IOException
Computes the new header and then calls MP3RetaggingInputStream(InputStream, byte[])

Throws:
org.blinkenlights.jid3.ID3Exception
IOException

MP3RetaggingInputStream

public MP3RetaggingInputStream(File source,
                               MP3Util.Metadata metadata)
                        throws org.blinkenlights.jid3.ID3Exception,
                               IOException
Computes the new header and then calls MP3RetaggingInputStream(InputStream, byte[])

Throws:
org.blinkenlights.jid3.ID3Exception
IOException
Method Detail

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception

read

public int read()
         throws IOException
Specified by:
read in class InputStream
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class InputStream
Throws:
IOException


Copyright © 2012. All Rights Reserved.