IOException
.
- * @param stream the input stream from which file format information should be
- * extracted
- * @return an AudioFileFormat
object describing the audio file format
- * @throws UnsupportedAudioFileException if the stream does not point to valid audio
- * file data recognized by the system
+ * support it. These parsers must be able to mark the stream, read enough
+ * data to determine whether they support the stream, and, if not, reset the
+ * stream's read pointer to its original position. If the input stream does
+ * not support this, this method may fail with an {@code IOException}.
+ *
+ * @param stream the input stream from which file format information should
+ * be extracted
+ * @return an {@code AudioFileFormat} object describing the audio file
+ * format
+ * @throws UnsupportedAudioFileException if the stream does not point to
+ * valid audio file data recognized by the system
* @throws IOException if an I/O exception occurs
* @see InputStream#markSupported
* @see InputStream#mark
*/
- public abstract AudioFileFormat getAudioFileFormat(InputStream stream) throws UnsupportedAudioFileException, IOException;
+ public abstract AudioFileFormat getAudioFileFormat(InputStream stream)
+ throws UnsupportedAudioFileException, IOException;
/**
- * Obtains the audio file format of the URL provided. The URL must
- * point to valid audio file data.
- * @param url the URL from which file format information should be
- * extracted
- * @return an AudioFileFormat
object describing the audio file format
- * @throws UnsupportedAudioFileException if the URL does not point to valid audio
- * file data recognized by the system
+ * Obtains the audio file format of the URL provided. The URL must point to
+ * valid audio file data.
+ *
+ * @param url the URL from which file format information should be
+ * extracted
+ * @return an {@code AudioFileFormat} object describing the audio file
+ * format
+ * @throws UnsupportedAudioFileException if the URL does not point to valid
+ * audio file data recognized by the system
* @throws IOException if an I/O exception occurs
*/
- public abstract AudioFileFormat getAudioFileFormat(URL url) throws UnsupportedAudioFileException, IOException;
+ public abstract AudioFileFormat getAudioFileFormat(URL url)
+ throws UnsupportedAudioFileException, IOException;
/**
- * Obtains the audio file format of the File
provided. The File
must
- * point to valid audio file data.
- * @param file the File
from which file format information should be
- * extracted
- * @return an AudioFileFormat
object describing the audio file format
- * @throws UnsupportedAudioFileException if the File
does not point to valid audio
- * file data recognized by the system
+ * Obtains the audio file format of the {@code File} provided.
+ * The {@code File} must point to valid audio file data.
+ *
+ * @param file the {@code File} from which file format information
+ * should be extracted
+ * @return an {@code AudioFileFormat} object describing the audio file
+ * format
+ * @throws UnsupportedAudioFileException if the {@code File} does not point
+ * to valid audio file data recognized by the system
* @throws IOException if an I/O exception occurs
*/
- public abstract AudioFileFormat getAudioFileFormat(File file) throws UnsupportedAudioFileException, IOException;
+ public abstract AudioFileFormat getAudioFileFormat(File file)
+ throws UnsupportedAudioFileException, IOException;
/**
- * Obtains an audio input stream from the input stream provided. The stream must
- * point to valid audio file data. In general, audio file readers may
+ * Obtains an audio input stream from the input stream provided. The stream
+ * must point to valid audio file data. In general, audio file readers may
* need to read some data from the stream before determining whether they
- * support it. These parsers must
- * be able to mark the stream, read enough data to determine whether they
- * support the stream, and, if not, reset the stream's read pointer to its original
- * position. If the input stream does not support this, this method may fail
- * with an IOException
.
- * @param stream the input stream from which the AudioInputStream
should be
- * constructed
- * @return an AudioInputStream
object based on the audio file data contained
- * in the input stream.
- * @throws UnsupportedAudioFileException if the stream does not point to valid audio
- * file data recognized by the system
+ * support it. These parsers must be able to mark the stream, read enough
+ * data to determine whether they support the stream, and, if not, reset the
+ * stream's read pointer to its original position. If the input stream does
+ * not support this, this method may fail with an {@code IOException}.
+ *
+ * @param stream the input stream from which the {@code AudioInputStream}
+ * should be constructed
+ * @return an {@code AudioInputStream} object based on the audio file data
+ * contained in the input stream.
+ * @throws UnsupportedAudioFileException if the stream does not point to
+ * valid audio file data recognized by the system
* @throws IOException if an I/O exception occurs
* @see InputStream#markSupported
* @see InputStream#mark
*/
- public abstract AudioInputStream getAudioInputStream(InputStream stream) throws UnsupportedAudioFileException, IOException;
+ public abstract AudioInputStream getAudioInputStream(InputStream stream)
+ throws UnsupportedAudioFileException, IOException;
/**
- * Obtains an audio input stream from the URL provided. The URL must
- * point to valid audio file data.
- * @param url the URL for which the AudioInputStream
should be
- * constructed
- * @return an AudioInputStream
object based on the audio file data pointed
- * to by the URL
- * @throws UnsupportedAudioFileException if the URL does not point to valid audio
- * file data recognized by the system
+ * Obtains an audio input stream from the URL provided. The URL must point
+ * to valid audio file data.
+ *
+ * @param url the URL for which the {@code AudioInputStream} should be
+ * constructed
+ * @return an {@code AudioInputStream} object based on the audio file data
+ * pointed to by the URL
+ * @throws UnsupportedAudioFileException if the URL does not point to valid
+ * audio file data recognized by the system
* @throws IOException if an I/O exception occurs
*/
- public abstract AudioInputStream getAudioInputStream(URL url) throws UnsupportedAudioFileException, IOException;
+ public abstract AudioInputStream getAudioInputStream(URL url)
+ throws UnsupportedAudioFileException, IOException;
/**
- * Obtains an audio input stream from the File
provided. The File
must
- * point to valid audio file data.
- * @param file the File
for which the AudioInputStream
should be
- * constructed
- * @return an AudioInputStream
object based on the audio file data pointed
- * to by the File
- * @throws UnsupportedAudioFileException if the File
does not point to valid audio
- * file data recognized by the system
+ * Obtains an audio input stream from the {@code File} provided.
+ * The {@code File} must point to valid audio file data.
+ *
+ * @param file the {@code File} for which the {@code AudioInputStream}
+ * should be constructed
+ * @return an {@code AudioInputStream} object based on the audio file data
+ * pointed to by the File
+ * @throws UnsupportedAudioFileException if the {@code File} does not point
+ * to valid audio file data recognized by the system
* @throws IOException if an I/O exception occurs
*/
- public abstract AudioInputStream getAudioInputStream(File file) throws UnsupportedAudioFileException, IOException;
+ public abstract AudioInputStream getAudioInputStream(File file)
+ throws UnsupportedAudioFileException, IOException;
}
diff -r 4f5e79f02d71 -r 81c6f1aff26e jdk/src/share/classes/javax/sound/sampled/spi/AudioFileWriter.java
--- a/jdk/src/share/classes/javax/sound/sampled/spi/AudioFileWriter.java Mon May 12 09:38:27 2014 -0700
+++ b/jdk/src/share/classes/javax/sound/sampled/spi/AudioFileWriter.java Tue May 13 16:06:12 2014 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -26,16 +26,15 @@
package javax.sound.sampled.spi;
import java.io.File;
-import java.io.InputStream;
import java.io.IOException;
import java.io.OutputStream;
-import javax.sound.sampled.AudioFileFormat;
import javax.sound.sampled.AudioInputStream;
+import static javax.sound.sampled.AudioFileFormat.Type;
/**
- * Provider for audio file writing services. Classes providing concrete
+ * Provider for audio file writing services. Classes providing concrete
* implementations can write one or more types of audio file from an audio
* stream.
*
@@ -47,22 +46,23 @@
/**
* Obtains the file types for which file writing support is provided by this
* audio file writer.
- * @return array of file types. If no file types are supported,
- * an array of length 0 is returned.
+ *
+ * @return array of file types. If no file types are supported, an array of
+ * length 0 is returned.
*/
- public abstract AudioFileFormat.Type[] getAudioFileTypes();
-
+ public abstract Type[] getAudioFileTypes();
/**
- * Indicates whether file writing support for the specified file type is provided
- * by this audio file writer.
- * @param fileType the file type for which write capabilities are queried
- * @return true
if the file type is supported,
- * otherwise false
+ * Indicates whether file writing support for the specified file type is
+ * provided by this audio file writer.
+ *
+ * @param fileType the file type for which write capabilities are queried
+ * @return {@code true} if the file type is supported, otherwise
+ * {@code false}
*/
- public boolean isFileTypeSupported(AudioFileFormat.Type fileType) {
+ public boolean isFileTypeSupported(Type fileType) {
- AudioFileFormat.Type types[] = getAudioFileTypes();
+ Type types[] = getAudioFileTypes();
for(int i=0; ifalse
+ * Indicates whether an audio file of the type specified can be written from
+ * the audio input stream indicated.
+ *
+ * @param fileType file type for which write capabilities are queried
+ * @param stream for which file writing support is queried
+ * @return {@code true} if the file type is supported for this audio input
+ * stream, otherwise {@code false}
*/
- public boolean isFileTypeSupported(AudioFileFormat.Type fileType, AudioInputStream stream) {
+ public boolean isFileTypeSupported(Type fileType, AudioInputStream stream) {
- AudioFileFormat.Type types[] = getAudioFileTypes( stream );
+ Type types[] = getAudioFileTypes( stream );
for(int i=0; i
- * The target format represents the format of the processed, converted
- * audio data. This is the format of the data that can be read from
- * the stream returned by one of the
- * The full set of mixer info objects that represent the mixers supported
- * by this {@code MixerProvider} may be obtained
- * through the {@code getMixerInfo} method.
+ * The full set of mixer info objects that represent the mixers supported by
+ * this {@code MixerProvider} may be obtained through the
+ * {@code getMixerInfo} method.
*
- * @param info an info object that describes the mixer for which support is queried
- * @return {@code true} if the specified mixer is supported,
- * otherwise {@code false}
+ * @param info an info object that describes the mixer for which support is
+ * queried
+ * @return {@code true} if the specified mixer is supported, otherwise
+ * {@code false}
* @see #getMixerInfo()
*/
public boolean isMixerSupported(Mixer.Info info) {
@@ -64,38 +63,34 @@
return false;
}
-
/**
- * Obtains the set of info objects representing the mixer
- * or mixers provided by this MixerProvider.
+ * Obtains the set of info objects representing the mixer or mixers provided
+ * by this MixerProvider.
*
- * The {@code isMixerSupported} method returns {@code true}
- * for all the info objects returned by this method.
- * The corresponding mixer instances for the info objects
- * are returned by the {@code getMixer} method.
+ * The {@code isMixerSupported} method returns {@code true} for all the info
+ * objects returned by this method. The corresponding mixer instances for
+ * the info objects are returned by the {@code getMixer} method.
*
* @return a set of mixer info objects
- * @see #getMixer(javax.sound.sampled.Mixer.Info) getMixer(Mixer.Info)
- * @see #isMixerSupported(javax.sound.sampled.Mixer.Info) isMixerSupported(Mixer.Info)
+ * @see #getMixer(Mixer.Info)
+ * @see #isMixerSupported(Mixer.Info)
*/
public abstract Mixer.Info[] getMixerInfo();
-
/**
* Obtains an instance of the mixer represented by the info object.
*
* The full set of the mixer info objects that represent the mixers
- * supported by this {@code MixerProvider} may be obtained
- * through the {@code getMixerInfo} method.
- * Use the {@code isMixerSupported} method to test whether
- * this {@code MixerProvider} supports a particular mixer.
+ * supported by this {@code MixerProvider} may be obtained through the
+ * {@code getMixerInfo} method. Use the {@code isMixerSupported} method to
+ * test whether this {@code MixerProvider} supports a particular mixer.
*
- * @param info an info object that describes the desired mixer
+ * @param info an info object that describes the desired mixer
* @return mixer instance
* @throws IllegalArgumentException if the info object specified does not
- * match the info object for a mixer supported by this MixerProvider.
+ * match the info object for a mixer supported by this MixerProvider
* @see #getMixerInfo()
- * @see #isMixerSupported(javax.sound.sampled.Mixer.Info) isMixerSupported(Mixer.Info)
+ * @see #isMixerSupported(Mixer.Info)
*/
public abstract Mixer getMixer(Mixer.Info info);
}
getAudioInputStream
methods.
+ * The target format represents the format of the processed, converted audio
+ * data. This is the format of the data that can be read from the stream
+ * returned by one of the {@code getAudioInputStream} methods.
*
* @author Kara Kytle
* @since 1.3
*/
public abstract class FormatConversionProvider {
-
- // NEW METHODS
+ /**
+ * Obtains the set of source format encodings from which format conversion
+ * services are provided by this provider.
+ *
+ * @return array of source format encodings. If for some reason provider
+ * does not provide any conversion services, an array of length 0 is
+ * returned.
+ */
+ public abstract Encoding[] getSourceEncodings();
/**
- * Obtains the set of source format encodings from which format
- * conversion services are provided by this provider.
- * @return array of source format encodings. If for some reason provider
- * does not provide any conversion services, an array of length 0 is
- * returned.
+ * Obtains the set of target format encodings to which format conversion
+ * services are provided by this provider.
+ *
+ * @return array of target format encodings. If for some reason provider
+ * does not provide any conversion services, an array of length 0 is
+ * returned.
*/
- public abstract AudioFormat.Encoding[] getSourceEncodings();
-
-
- /**
- * Obtains the set of target format encodings to which format
- * conversion services are provided by this provider.
- * @return array of target format encodings. If for some reason provider
- * does not provide any conversion services, an array of length 0 is
- * returned.
- */
- public abstract AudioFormat.Encoding[] getTargetEncodings();
-
+ public abstract Encoding[] getTargetEncodings();
/**
* Indicates whether the format converter supports conversion from the
* specified source format encoding.
- * @param sourceEncoding the source format encoding for which support is queried
- * @return true
if the encoding is supported, otherwise false
+ *
+ * @param sourceEncoding the source format encoding for which support is
+ * queried
+ * @return {@code true} if the encoding is supported, otherwise
+ * {@code false}
*/
- public boolean isSourceEncodingSupported(AudioFormat.Encoding sourceEncoding){
+ public boolean isSourceEncodingSupported(Encoding sourceEncoding) {
- AudioFormat.Encoding sourceEncodings[] = getSourceEncodings();
+ Encoding sourceEncodings[] = getSourceEncodings();
for(int i=0; ifalse
+ *
+ * @param targetEncoding the target format encoding for which support is
+ * queried
+ * @return {@code true} if the encoding is supported, otherwise
+ * {@code false}
*/
- public boolean isTargetEncodingSupported(AudioFormat.Encoding targetEncoding){
+ public boolean isTargetEncodingSupported(Encoding targetEncoding) {
- AudioFormat.Encoding targetEncodings[] = getTargetEncodings();
+ Encoding targetEncodings[] = getTargetEncodings();
for(int i=0; ifalse
+ * Indicates whether the format converter supports conversion to a
+ * particular encoding from a particular format.
+ *
+ * @param targetEncoding desired encoding of the outgoing data
+ * @param sourceFormat format of the incoming data
+ * @return {@code true} if the conversion is supported, otherwise
+ * {@code false}
*/
- public boolean isConversionSupported(AudioFormat.Encoding targetEncoding, AudioFormat sourceFormat){
+ public boolean isConversionSupported(Encoding targetEncoding,
+ AudioFormat sourceFormat) {
- AudioFormat.Encoding targetEncodings[] = getTargetEncodings(sourceFormat);
+ Encoding targetEncodings[] = getTargetEncodings(sourceFormat);
for(int i=0; ifalse
+ *
+ * @param targetFormat desired format of outgoing data
+ * @param sourceFormat format of the incoming data
+ * @return {@code true} if the conversion is supported, otherwise
+ * {@code false}
*/
- public boolean isConversionSupported(AudioFormat targetFormat, AudioFormat sourceFormat){
+ public boolean isConversionSupported(AudioFormat targetFormat,
+ AudioFormat sourceFormat) {
AudioFormat targetFormats[] = getTargetFormats( targetFormat.getEncoding(), sourceFormat );
@@ -173,28 +177,33 @@
return false;
}
+ /**
+ * Obtains an audio input stream with the specified encoding from the given
+ * audio input stream.
+ *
+ * @param targetEncoding desired encoding of the stream after processing
+ * @param sourceStream stream from which data to be processed should be
+ * read
+ * @return stream from which processed data with the specified target
+ * encoding may be read
+ * @throws IllegalArgumentException if the format combination supplied is
+ * not supported.
+ */
+ public abstract AudioInputStream getAudioInputStream(
+ Encoding targetEncoding, AudioInputStream sourceStream);
/**
- * Obtains an audio input stream with the specified encoding from the given audio
- * input stream.
- * @param targetEncoding desired encoding of the stream after processing
- * @param sourceStream stream from which data to be processed should be read
- * @return stream from which processed data with the specified target encoding may be read
+ * Obtains an audio input stream with the specified format from the given
+ * audio input stream.
+ *
+ * @param targetFormat desired data format of the stream after processing
+ * @param sourceStream stream from which data to be processed should be
+ * read
+ * @return stream from which processed data with the specified format may be
+ * read
* @throws IllegalArgumentException if the format combination supplied is
- * not supported.
+ * not supported.
*/
- public abstract AudioInputStream getAudioInputStream(AudioFormat.Encoding targetEncoding, AudioInputStream sourceStream);
-
-
- /**
- * Obtains an audio input stream with the specified format from the given audio
- * input stream.
- * @param targetFormat desired data format of the stream after processing
- * @param sourceStream stream from which data to be processed should be read
- * @return stream from which processed data with the specified format may be read
- * @throws IllegalArgumentException if the format combination supplied is
- * not supported.
- */
- public abstract AudioInputStream getAudioInputStream(AudioFormat targetFormat, AudioInputStream sourceStream);
-
+ public abstract AudioInputStream getAudioInputStream(
+ AudioFormat targetFormat, AudioInputStream sourceStream);
}
diff -r 4f5e79f02d71 -r 81c6f1aff26e jdk/src/share/classes/javax/sound/sampled/spi/MixerProvider.java
--- a/jdk/src/share/classes/javax/sound/sampled/spi/MixerProvider.java Mon May 12 09:38:27 2014 -0700
+++ b/jdk/src/share/classes/javax/sound/sampled/spi/MixerProvider.java Tue May 13 16:06:12 2014 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -28,28 +28,27 @@
import javax.sound.sampled.Mixer;
/**
- * A provider or factory for a particular mixer type.
- * This mechanism allows the implementation to determine
- * how resources are managed in creation / management of
- * a mixer.
+ * A provider or factory for a particular mixer type. This mechanism allows the
+ * implementation to determine how resources are managed in creation /
+ * management of a mixer.
*
* @author Kara Kytle
* @since 1.3
*/
public abstract class MixerProvider {
-
/**
* Indicates whether the mixer provider supports the mixer represented by
* the specified mixer info object.
*