public abstract class AudioFileWriter extends Object
Provider for audio file writing services. Classes providing concrete implementations can write one or more types of audio file from an audio stream.
public AudioFileWriter()
public abstract AudioFileFormat.Type[] getAudioFileTypes()
Obtains the file types for which file writing support is provided by this audio file writer.
public boolean isFileTypeSupported(AudioFileFormat.Type fileType)
Indicates whether file writing support for the specified file type is provided by this audio file writer.
fileType
- the file type for which write capabilities are queriedtrue
if the file type is supported, otherwise false
public abstract AudioFileFormat.Type[] getAudioFileTypes(AudioInputStream stream)
Obtains the file types that this audio file writer can write from the audio input stream specified.
stream
- the audio input stream for which audio file type support is queriedpublic boolean isFileTypeSupported(AudioFileFormat.Type fileType, AudioInputStream stream)
Indicates whether an audio file of the type specified can be written from the audio input stream indicated.
fileType
- file type for which write capabilities are queriedstream
- for which file writing support is queriedtrue
if the file type is supported for this audio input stream, otherwise false
public abstract int write(AudioInputStream stream, AudioFileFormat.Type fileType, OutputStream out) throws IOException
Writes a stream of bytes representing an audio file of the file type indicated to the output stream provided. Some file types require that the length be written into the file header, and cannot be written from start to finish unless the length is known in advance. An attempt to write such a file type will fail with an IOException if the length in the audio file format is AudioSystem.NOT_SPECIFIED
.
stream
- the audio input stream containing audio data to be written to the output streamfileType
- file type to be written to the output streamout
- stream to which the file data should be writtenIOException
- if an I/O exception occursIllegalArgumentException
- if the file type is not supported by the systemisFileTypeSupported(AudioFileFormat.Type, AudioInputStream)
, getAudioFileTypes()
public abstract int write(AudioInputStream stream, AudioFileFormat.Type fileType, File out) throws IOException
Writes a stream of bytes representing an audio file of the file format indicated to the external file provided.
stream
- the audio input stream containing audio data to be written to the filefileType
- file type to be written to the fileout
- external file to which the file data should be writtenIOException
- if an I/O exception occursIllegalArgumentException
- if the file format is not supported by the systemisFileTypeSupported(javax.sound.sampled.AudioFileFormat.Type)
, getAudioFileTypes()
© 1993–2017, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.