8050465: Remove sun.audio package
authorpchelko
Wed, 16 Jul 2014 15:35:36 +0400
changeset 25781 05b1d834ef81
parent 25780 9ece64e7ca1a
child 25782 5a832643a534
8050465: Remove sun.audio package Reviewed-by: anthony, serb
jdk/src/share/classes/sun/audio/AudioData.java
jdk/src/share/classes/sun/audio/AudioDataStream.java
jdk/src/share/classes/sun/audio/AudioDevice.java
jdk/src/share/classes/sun/audio/AudioPlayer.java
jdk/src/share/classes/sun/audio/AudioSecurityAction.java
jdk/src/share/classes/sun/audio/AudioSecurityExceptionAction.java
jdk/src/share/classes/sun/audio/AudioStream.java
jdk/src/share/classes/sun/audio/AudioStreamSequence.java
jdk/src/share/classes/sun/audio/AudioTranslatorStream.java
jdk/src/share/classes/sun/audio/ContinuousAudioDataStream.java
jdk/src/share/classes/sun/audio/InvalidAudioFormatException.java
jdk/src/share/classes/sun/audio/NativeAudioStream.java
--- a/jdk/src/share/classes/sun/audio/AudioData.java	Tue Jul 15 14:57:34 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +0,0 @@
-/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.audio;
-
-import java.io.*;
-import java.util.Arrays;
-
-import javax.sound.sampled.*;
-
-
-/**
- * A clip of audio data. This data can be used to construct an
- * AudioDataStream, which can be played. <p>
- *
- * @author  Arthur van Hoff
- * @author  Kara Kytle
- * @see     AudioDataStream
- * @see     AudioPlayer
- */
-
- /*
-  * the idea here is that the AudioData object encapsulates the
-  * data you need to play an audio clip based on a defined set
-  * of data.  to do this, you require the audio data (a byte
-  * array rather than an arbitrary input stream) and a format
-  * object.
-  */
-
-
-public final class AudioData {
-
-    private static final AudioFormat DEFAULT_FORMAT =
-        new AudioFormat(AudioFormat.Encoding.ULAW,
-                        8000,   // sample rate
-                        8,      // sample size in bits
-                        1,      // channels
-                        1,      // frame size in bytes
-                        8000,   // frame rate
-                        true ); // bigendian (irrelevant for 8-bit data)
-
-    AudioFormat format;   // carry forth the format array amusement
-    byte buffer[];
-
-    /**
-     * Constructor
-     */
-    public AudioData(final byte[] buffer) {
-        // if we cannot extract valid format information, we resort to assuming
-        // the data will be 8k mono u-law in order to provide maximal backwards
-        // compatibility....
-        this(DEFAULT_FORMAT, buffer);
-
-        // okay, we need to extract the format and the byte buffer of data
-        try {
-            AudioInputStream ais = AudioSystem.getAudioInputStream(new ByteArrayInputStream(buffer));
-            this.format = ais.getFormat();
-            ais.close();
-            // $$fb 2002-10-27: buffer contains the file header now!
-        } catch (IOException e) {
-            // use default format
-        } catch (UnsupportedAudioFileException e1 ) {
-            // use default format
-        }
-    }
-
-
-    /**
-     * Non-public constructor; this is the one we use in ADS and CADS
-     * constructors.
-     */
-    AudioData(final AudioFormat format, final byte[] buffer) {
-        this.format = format;
-        if (buffer != null) {
-            this.buffer = Arrays.copyOf(buffer, buffer.length);
-        }
-    }
-}
--- a/jdk/src/share/classes/sun/audio/AudioDataStream.java	Tue Jul 15 14:57:34 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.audio;
-
-import java.io.*;
-
-/**
- * An input stream to play AudioData.
- *
- * @see AudioPlayer
- * @see AudioData
- * @author Arthur van Hoff
- * @author Kara Kytle
- */
-public class AudioDataStream extends ByteArrayInputStream {
-
-    private final AudioData ad;
-
-    /**
-     * Constructor
-     */
-    public AudioDataStream(final AudioData data) {
-
-        super(data.buffer);
-        this.ad = data;
-    }
-
-    final AudioData getAudioData() {
-        return ad;
-    }
-}
--- a/jdk/src/share/classes/sun/audio/AudioDevice.java	Tue Jul 15 14:57:34 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,419 +0,0 @@
-/*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.audio;
-
-import java.util.Hashtable;
-import java.util.Vector;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.BufferedInputStream;
-
-import javax.sound.sampled.*;
-import javax.sound.midi.*;
-import com.sun.media.sound.DataPusher;
-import com.sun.media.sound.Toolkit;
-
-/**
- * This class provides an interface to the Headspace Audio engine through
- * the Java Sound API.
- *
- * This class emulates systems with multiple audio channels, mixing
- * multiple streams for the workstation's single-channel device.
- *
- * @see AudioData
- * @see AudioDataStream
- * @see AudioStream
- * @see AudioStreamSequence
- * @see ContinuousAudioDataStream
- * @author David Rivas
- * @author Kara Kytle
- * @author Jan Borgersen
- * @author Florian Bomers
- */
-
-public final class AudioDevice {
-
-    private boolean DEBUG = false  /*true*/ ;
-
-    private Vector<Info> infos;
-
-    /** Are we currently playing audio? */
-    private boolean playing = false;
-
-    /** Handle to the JS audio mixer. */
-    private Mixer mixer = null;
-
-
-
-    /**
-     * The default audio player. This audio player is initialized
-     * automatically.
-     */
-    public static final AudioDevice device = new AudioDevice();
-
-    /**
-     * Create an AudioDevice instance.
-     */
-    private AudioDevice() {
-        infos = new Vector<>();
-    }
-
-
-    private synchronized void startSampled( AudioInputStream as,
-                                            InputStream in ) throws UnsupportedAudioFileException,
-                                  LineUnavailableException {
-
-        Info info = null;
-        DataPusher datapusher = null;
-        DataLine.Info lineinfo = null;
-        SourceDataLine sourcedataline = null;
-
-        // if ALAW or ULAW, we must convert....
-        as = Toolkit.getPCMConvertedAudioInputStream(as);
-
-        if( as==null ) {
-            // could not convert
-            return;
-        }
-
-        lineinfo = new DataLine.Info(SourceDataLine.class,
-                                     as.getFormat());
-        if( !(AudioSystem.isLineSupported(lineinfo))) {
-            return;
-        }
-        sourcedataline = (SourceDataLine)AudioSystem.getLine(lineinfo);
-        datapusher = new DataPusher(sourcedataline, as);
-
-        info = new Info( null, in, datapusher );
-        infos.addElement( info );
-
-        datapusher.start();
-    }
-
-    private synchronized void startMidi( InputStream bis,
-                                         InputStream in ) throws InvalidMidiDataException,
-                                  MidiUnavailableException  {
-
-        Sequencer sequencer = null;
-        Info info = null;
-
-        sequencer = MidiSystem.getSequencer( );
-        sequencer.open();
-        try {
-            sequencer.setSequence( bis );
-        } catch( IOException e ) {
-            throw new InvalidMidiDataException( e.getMessage() );
-        }
-
-        info = new Info( sequencer, in, null );
-
-        infos.addElement( info );
-
-        // fix for bug 4302884: Audio device is not released when AudioClip stops
-        sequencer.addMetaEventListener(info);
-
-        sequencer.start();
-
-    }
-
-
-
-    /**
-     *  Open an audio channel.
-     */
-    public synchronized void openChannel(InputStream in) {
-
-
-        if(DEBUG) {
-            System.out.println("AudioDevice: openChannel");
-            System.out.println("input stream =" + in);
-        }
-
-        Info info = null;
-
-        // is this already playing?  if so, then just return
-        for(int i=0; i<infos.size(); i++) {
-            info = infos.elementAt(i);
-            if( info.in == in ) {
-
-                return;
-            }
-        }
-
-
-        AudioInputStream as = null;
-
-        if( in instanceof AudioStream ) {
-
-            if ( ((AudioStream)in).midiformat != null ) {
-
-                // it's a midi file
-                try {
-                    startMidi( ((AudioStream)in).stream, in );
-                } catch (Exception e) {
-                    return;
-                }
-
-
-            } else if( ((AudioStream)in).ais != null ) {
-
-                // it's sampled audio
-                try {
-                    startSampled( ((AudioStream)in).ais, in );
-                } catch (Exception e) {
-                    return;
-                }
-
-            }
-        } else if (in instanceof AudioDataStream ) {
-            if (in instanceof ContinuousAudioDataStream) {
-                try {
-                    AudioInputStream ais = new AudioInputStream(in,
-                                                                ((AudioDataStream)in).getAudioData().format,
-                                                                AudioSystem.NOT_SPECIFIED);
-                    startSampled(ais, in );
-                } catch (Exception e) {
-                    return;
-                }
-            }
-            else {
-                try {
-                    AudioInputStream ais = new AudioInputStream(in,
-                                                                ((AudioDataStream)in).getAudioData().format,
-                                                                ((AudioDataStream)in).getAudioData().buffer.length);
-                    startSampled(ais, in );
-                } catch (Exception e) {
-                    return;
-                }
-            }
-        } else {
-            BufferedInputStream bis = new BufferedInputStream( in, 1024 );
-
-            try {
-
-                try {
-                    as = AudioSystem.getAudioInputStream(bis);
-                } catch(IOException ioe) {
-                    return;
-                }
-
-                startSampled( as, in );
-
-            } catch( UnsupportedAudioFileException e ) {
-
-                try {
-                    try {
-                        MidiFileFormat mff =
-                            MidiSystem.getMidiFileFormat( bis );
-                    } catch(IOException ioe1) {
-                        return;
-                    }
-
-                    startMidi( bis, in );
-
-
-                } catch( InvalidMidiDataException e1 ) {
-
-                    // $$jb:08.01.99: adding this section to make some of our other
-                    // legacy classes work.....
-                    // not MIDI either, special case handling for all others
-
-                    AudioFormat defformat = new AudioFormat( AudioFormat.Encoding.ULAW,
-                                                             8000, 8, 1, 1, 8000, true );
-                    try {
-                        AudioInputStream defaif = new AudioInputStream( bis,
-                                                                        defformat, AudioSystem.NOT_SPECIFIED);
-                        startSampled( defaif, in );
-                    } catch (UnsupportedAudioFileException es) {
-                        return;
-                    } catch (LineUnavailableException es2) {
-                        return;
-                    }
-
-                } catch( MidiUnavailableException e2 ) {
-
-                    // could not open sequence
-                    return;
-                }
-
-            } catch( LineUnavailableException e ) {
-
-                return;
-            }
-        }
-
-        // don't forget adjust for a new stream.
-        notify();
-    }
-
-
-    /**
-     *  Close an audio channel.
-     */
-    public synchronized void closeChannel(InputStream in) {
-
-        if(DEBUG) {
-            System.out.println("AudioDevice.closeChannel");
-        }
-
-        if (in == null) return;         // can't go anywhere here!
-
-        Info info;
-
-        for(int i=0; i<infos.size(); i++) {
-
-            info = infos.elementAt(i);
-
-            if( info.in == in ) {
-
-                if( info.sequencer != null ) {
-
-                    info.sequencer.stop();
-                    //info.sequencer.close();
-                    infos.removeElement( info );
-
-                } else if( info.datapusher != null ) {
-
-                    info.datapusher.stop();
-                    infos.removeElement( info );
-                }
-            }
-        }
-        notify();
-    }
-
-
-    /**
-     * Open the device (done automatically)
-     */
-    public synchronized void open() {
-
-        // $$jb: 06.24.99: This is done on a per-stream
-        // basis using the new JS API now.
-    }
-
-
-    /**
-     * Close the device (done automatically)
-     */
-    public synchronized void close() {
-
-        // $$jb: 06.24.99: This is done on a per-stream
-        // basis using the new JS API now.
-
-    }
-
-
-    /**
-     * Play open audio stream(s)
-     */
-    public void play() {
-
-        // $$jb: 06.24.99:  Holdover from old architechture ...
-        // we now open/close the devices as needed on a per-stream
-        // basis using the JavaSound API.
-
-        if (DEBUG) {
-            System.out.println("exiting play()");
-        }
-    }
-
-    /**
-     * Close streams
-     */
-    public synchronized void closeStreams() {
-
-        Info info;
-
-        for(int i=0; i<infos.size(); i++) {
-
-            info = infos.elementAt(i);
-
-            if( info.sequencer != null ) {
-
-                info.sequencer.stop();
-                info.sequencer.close();
-                infos.removeElement( info );
-
-            } else if( info.datapusher != null ) {
-
-                info.datapusher.stop();
-                infos.removeElement( info );
-            }
-        }
-
-
-        if (DEBUG) {
-            System.err.println("Audio Device: Streams all closed.");
-        }
-        // Empty the hash table.
-        infos = new Vector<>();
-    }
-
-    /**
-     * Number of channels currently open.
-     */
-    public int openChannels() {
-        return infos.size();
-    }
-
-    /**
-     * Make the debug info print out.
-     */
-    void setVerbose(boolean v) {
-        DEBUG = v;
-    }
-
-
-
-
-
-
-    // INFO CLASS
-
-    final class Info implements MetaEventListener {
-
-        final Sequencer   sequencer;
-        final InputStream in;
-        final DataPusher  datapusher;
-
-        Info( Sequencer sequencer, InputStream in, DataPusher datapusher ) {
-
-            this.sequencer  = sequencer;
-            this.in         = in;
-            this.datapusher = datapusher;
-        }
-
-        public void meta(MetaMessage event) {
-            if (event.getType() == 47 && sequencer != null) {
-                sequencer.close();
-            }
-        }
-    }
-
-
-
-}
--- a/jdk/src/share/classes/sun/audio/AudioPlayer.java	Tue Jul 15 14:57:34 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,186 +0,0 @@
-/*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.audio;
-
-import java.io.InputStream;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-
-/**
- * This class provides an interface to play audio streams.
- *
- * To play an audio stream use:
- * <pre>
- *      AudioPlayer.player.start(audiostream);
- * </pre>
- * To stop playing an audio stream use:
- * <pre>
- *      AudioPlayer.player.stop(audiostream);
- * </pre>
- * To play an audio stream from a URL use:
- * <pre>
- *      AudioStream audiostream = new AudioStream(url.openStream());
- *      AudioPlayer.player.start(audiostream);
- * </pre>
- * To play a continuous sound you first have to
- * create an AudioData instance and use it to construct a
- * ContinuousAudioDataStream.
- * For example:
- * <pre>
- *      AudioData data = new AudioStream(url.openStream()).getData();
- *      ContinuousAudioDataStream audiostream = new ContinuousAudioDataStream(data);
- *      AudioPlayer.player.start(audiostream);
- * </pre>
- *
- * @see AudioData
- * @see AudioDataStream
- * @see AudioDevice
- * @see AudioStream
- * @author Arthur van Hoff, Thomas Ball
- */
-
-public final class AudioPlayer extends Thread {
-
-        private final AudioDevice devAudio;
-        private final static boolean DEBUG = false /*true*/;
-
-        /**
-         * The default audio player. This audio player is initialized
-         * automatically.
-         */
-        public static final AudioPlayer player = getAudioPlayer();
-
-        private static ThreadGroup getAudioThreadGroup() {
-
-            if(DEBUG) { System.out.println("AudioPlayer.getAudioThreadGroup()"); }
-            ThreadGroup g = currentThread().getThreadGroup();
-            while ((g.getParent() != null) &&
-                   (g.getParent().getParent() != null)) {
-                g = g.getParent();
-            }
-            return g;
-        }
-
-        /**
-         * Create an AudioPlayer thread in a privileged block.
-         */
-
-        private static AudioPlayer getAudioPlayer() {
-
-            if(DEBUG) { System.out.println("> AudioPlayer.getAudioPlayer()"); }
-            PrivilegedAction<AudioPlayer> action = new PrivilegedAction<AudioPlayer>() {
-                    public AudioPlayer run() {
-                        AudioPlayer t = new AudioPlayer();
-                        t.setPriority(MAX_PRIORITY);
-                        t.setDaemon(true);
-                        t.start();
-                        return t;
-                    }
-                };
-            return  AccessController.doPrivileged(action);
-        }
-
-        /**
-         * Construct an AudioPlayer.
-         */
-        private AudioPlayer() {
-
-            super(getAudioThreadGroup(), "Audio Player");
-            if(DEBUG) { System.out.println("> AudioPlayer private constructor"); }
-            devAudio = AudioDevice.device;
-            devAudio.open();
-            if(DEBUG) { System.out.println("< AudioPlayer private constructor completed"); }
-        }
-
-
-        /**
-         * Start playing a stream. The stream will continue to play
-         * until the stream runs out of data, or it is stopped.
-         * @see AudioPlayer#stop
-         */
-        public synchronized void start(InputStream in) {
-
-            if(DEBUG) {
-                System.out.println("> AudioPlayer.start");
-                System.out.println("  InputStream = " + in);
-            }
-            devAudio.openChannel(in);
-            notify();
-            if(DEBUG) {
-                System.out.println("< AudioPlayer.start completed");
-            }
-        }
-
-        /**
-         * Stop playing a stream. The stream will stop playing,
-         * nothing happens if the stream wasn't playing in the
-         * first place.
-         * @see AudioPlayer#start
-         */
-        public synchronized void stop(InputStream in) {
-
-            if(DEBUG) {
-                System.out.println("> AudioPlayer.stop");
-            }
-
-            devAudio.closeChannel(in);
-            if(DEBUG) {
-                System.out.println("< AudioPlayer.stop completed");
-            }
-        }
-
-        /**
-         * Main mixing loop. This is called automatically when the AudioPlayer
-         * is created.
-         */
-        public void run() {
-
-            // $$jb: 06.24.99: With the JS API, mixing is no longer done by AudioPlayer
-            // or AudioDevice ... it's done by the API itself, so this bit of legacy
-            // code does nothing.
-            // $$jb: 10.21.99: But it appears that some legacy applications
-            // check to see if this thread is alive or not, so we need to spin here.
-
-            devAudio.play();
-            if(DEBUG) {
-                System.out.println("AudioPlayer mixing loop.");
-            }
-            while(true) {
-                try{
-                    Thread.sleep(5000);
-                    //wait();
-                } catch(Exception e) {
-                    break;
-                    // interrupted
-                }
-            }
-            if(DEBUG) {
-                System.out.println("AudioPlayer exited.");
-            }
-
-        }
-    }
--- a/jdk/src/share/classes/sun/audio/AudioSecurityAction.java	Tue Jul 15 14:57:34 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.audio;
-
-public interface AudioSecurityAction {
-    Object run();
-}
--- a/jdk/src/share/classes/sun/audio/AudioSecurityExceptionAction.java	Tue Jul 15 14:57:34 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.audio;
-
-public interface AudioSecurityExceptionAction {
-    Object run() throws Exception;
-}
--- a/jdk/src/share/classes/sun/audio/AudioStream.java	Tue Jul 15 14:57:34 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,142 +0,0 @@
-/*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.audio;
-
-import java.io.InputStream;
-import java.io.FilterInputStream;
-import java.io.BufferedInputStream;
-import java.io.IOException;
-
-import javax.sound.sampled.*;
-import javax.sound.midi.*;
-
-/**
- * Convert an InputStream to an AudioStream.
- *
- */
-
-
-public final class AudioStream extends FilterInputStream {
-
-    // AudioContainerInputStream acis;
-    AudioInputStream ais = null;
-    AudioFormat format = null;
-    MidiFileFormat midiformat = null;
-    InputStream stream = null;
-
-
-    /*
-     * create the AudioStream; if we survive without throwing
-     * an exception, we should now have some subclass of
-     * ACIS with all the header info already read
-     */
-
-    public AudioStream(InputStream in) throws IOException {
-
-        super(in);
-
-        stream = in;
-
-        if( in.markSupported() == false ) {
-
-            stream = new BufferedInputStream( in, 1024 );
-        }
-
-        try {
-            ais = AudioSystem.getAudioInputStream( stream );
-            format = ais.getFormat();
-            this.in = ais;
-
-        } catch (UnsupportedAudioFileException e ) {
-
-            // not an audio file, see if it's midi...
-            try {
-                midiformat = MidiSystem.getMidiFileFormat( stream );
-
-            } catch (InvalidMidiDataException e1) {
-                throw new IOException("could not create audio stream from input stream");
-            }
-        }
-    }
-
-
-
-
-    /**
-     * A blocking read.
-     */
-    /*    public int read(byte buf[], int pos, int len) throws IOException {
-
-          return(acis.readFully(buf, pos, len));
-          }
-    */
-
-    /**
-     * Get the data.
-     */
-    public AudioData getData() throws IOException {
-        int length = getLength();
-
-        //limit the memory to 1M, so too large au file won't load
-        if (length < 1024*1024) {
-            byte [] buffer = new byte[length];
-            try {
-                ais.read(buffer, 0, length);
-            } catch (IOException ex) {
-                throw new IOException("Could not create AudioData Object");
-            }
-            return new AudioData(format, buffer);
-        }
-
-        /*              acis.setData();
-
-                        if (acis.stream instanceof ByteArrayInputStream) {
-                        Format[] format = acis.getFormat();
-                        byte[] bytes = acis.getBytes();
-                        if (bytes == null)
-                        throw new IOException("could not create AudioData object: no data received");
-                        return new AudioData((AudioFormat)format[0], bytes);
-                        }
-        */
-
-        throw new IOException("could not create AudioData object");
-    }
-
-
-    public int getLength() {
-
-        if( ais != null && format != null ) {
-            return (int) (ais.getFrameLength() *
-                          ais.getFormat().getFrameSize() );
-
-        } else if ( midiformat != null ) {
-            return midiformat.getByteLength();
-
-        } else {
-            return -1;
-        }
-    }
-}
--- a/jdk/src/share/classes/sun/audio/AudioStreamSequence.java	Tue Jul 15 14:57:34 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.audio;
-
-import java.io.InputStream;
-import java.io.SequenceInputStream;
-import java.util.Enumeration;
-
-/**
- * Convert a sequence of input streams into a single InputStream.
- * This class can be used to play two audio clips in sequence.<p>
- * For example:
- * <pre>
- *      Vector v = new Vector();
- *      v.addElement(audiostream1);
- *      v.addElement(audiostream2);
- *      AudioStreamSequence audiostream = new AudioStreamSequence(v.elements());
- *      AudioPlayer.player.start(audiostream);
- * </pre>
- * @see AudioPlayer
- * @author Arthur van Hoff
- */
-public final class AudioStreamSequence extends SequenceInputStream {
-        /**
-         * Create an AudioStreamSequence given an
-         * enumeration of streams.
-         */
-        public AudioStreamSequence(Enumeration<? extends InputStream> e) {
-            super(e);
-        }
-}
--- a/jdk/src/share/classes/sun/audio/AudioTranslatorStream.java	Tue Jul 15 14:57:34 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.audio;
-
-import java.io.InputStream;
-import java.io.IOException;
-
-/**
- * Translator for native audio formats (not implemented in this release).
- *
- */
-public final class AudioTranslatorStream extends NativeAudioStream {
-
-        private final int length = 0;
-
-        public AudioTranslatorStream(InputStream in) throws IOException {
-            super(in);
-            // No translators supported yet.
-            throw new InvalidAudioFormatException();
-        }
-
-        public int getLength() {
-            return length;
-        }
-    }
--- a/jdk/src/share/classes/sun/audio/ContinuousAudioDataStream.java	Tue Jul 15 14:57:34 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.audio;
-
-/**
- * Create a continuous audio stream. This wraps a stream
- * around an AudioData object, the stream is restarted
- * at the beginning everytime the end is reached, thus
- * creating continuous sound.<p>
- * For example:
- * <pre>
- *   AudioData data = AudioData.getAudioData(url);
- *   ContinuousAudioDataStream audiostream = new ContinuousAudioDataStream(data);
- *   AudioPlayer.player.start(audiostream);
- * </pre>
- *
- * @see AudioPlayer
- * @see AudioData
- * @author Arthur van Hoff
- */
-
-public final class ContinuousAudioDataStream extends AudioDataStream {
-
-
-    /**
-         * Create a continuous stream of audio.
-         */
-        public ContinuousAudioDataStream(AudioData data) {
-
-            super(data);
-        }
-
-
-        public int read() {
-
-            int i = super.read();
-
-            if (i == -1) {
-                reset();
-                i = super.read();
-            }
-
-            return i;
-        }
-
-
-        public int read(byte ab[], int i1, int j) {
-
-            int k;
-
-            for (k = 0; k < j; ) {
-                int i2 = super.read(ab, i1 + k, j - k);
-                if (i2 >= 0) k += i2;
-                else reset();
-            }
-
-            return k;
-        }
-    }
--- a/jdk/src/share/classes/sun/audio/InvalidAudioFormatException.java	Tue Jul 15 14:57:34 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.audio;
-import java.io.IOException;
-
-/**
- * Signals an invalid audio stream for the stream handler.
- */
-@SuppressWarnings("serial") // JDK-implementation class
-final class InvalidAudioFormatException extends IOException {
-
-
-    /**
-     * Constructor.
-     */
-    InvalidAudioFormatException() {
-        super();
-    }
-
-    /**
-     * Constructor with a detail message.
-     */
-    InvalidAudioFormatException(String s) {
-        super(s);
-    }
-}
--- a/jdk/src/share/classes/sun/audio/NativeAudioStream.java	Tue Jul 15 14:57:34 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.audio;
-
-import java.io.InputStream;
-import java.io.DataInputStream;
-import java.io.FilterInputStream;
-import java.io.IOException;
-
-/**
- * A Sun-specific AudioStream that supports native audio formats.
- *
- */
-
- /*
- * note: this file used to do the real header reading and
- * format verification for .au files (the only kind supported).
- * now we are way more cool than that and don't need this
- * functionality here; i'm just gutting this class and letting
- * it contain an ACIS instead (so now it should work for
- * all the data types we support....).
- */
-
-public
-    class NativeAudioStream extends FilterInputStream {
-
-
-        public NativeAudioStream(InputStream in) throws IOException {
-
-            super(in);
-        }
-
-        public int getLength() {
-            return 0;
-        }
-    }