jdk/src/share/classes/com/sun/media/sound/AiffFileReader.java
author amenkov
Wed, 06 Apr 2011 15:12:33 +0400
changeset 9215 cab45ca6ab44
parent 5506 202f599c92aa
child 18215 b2afd66ce6db
permissions -rw-r--r--
6992523: FindBugs scan - Malicious code vulnerability Warnings in com.sun.media.sound.* Reviewed-by: alexp
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     2
 * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package com.sun.media.sound;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.util.Vector;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.io.File;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.io.InputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.io.OutputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import java.io.IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import java.io.EOFException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import java.net.URL;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import java.net.MalformedURLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
import java.io.BufferedInputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
import java.io.BufferedOutputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
import java.io.DataInputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
import java.io.FileInputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
import java.io.DataOutputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
import java.io.FileOutputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
import java.io.ByteArrayInputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
import java.io.ByteArrayOutputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
import java.io.SequenceInputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
import javax.sound.sampled.AudioFileFormat;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
import javax.sound.sampled.AudioInputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
import javax.sound.sampled.AudioFormat;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
import javax.sound.sampled.AudioSystem;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
import javax.sound.sampled.UnsupportedAudioFileException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 * AIFF file reader and writer.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 * @author Kara Kytle
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 * @author Jan Borgersen
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 * @author Florian Bomers
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
public class AiffFileReader extends SunFileReader  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
    private static final int MAX_READ_LENGTH = 8;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
     * AIFF parser type
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    public static final AudioFileFormat.Type types[] = {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
        AudioFileFormat.Type.AIFF
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
    };
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
     * Constructs a new AiffParser object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    public AiffFileReader() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    // METHODS TO IMPLEMENT AudioFileReader
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     * Obtains the audio file format of the input stream provided.  The stream must
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
     * point to valid audio file data.  In general, audio file providers may
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     * need to read some data from the stream before determining whether they
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     * support it.  These parsers must
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     * be able to mark the stream, read enough data to determine whether they
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * support the stream, and, if not, reset the stream's read pointer to its original
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     * position.  If the input stream does not support this, this method may fail
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     * with an IOException.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     * @param stream the input stream from which file format information should be
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     * extracted
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     * @return an <code>AudioFileFormat</code> object describing the audio file format
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     * @throws UnsupportedAudioFileException if the stream does not point to valid audio
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
     * file data recognized by the system
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
     * @throws IOException if an I/O exception occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     * @see InputStream#markSupported
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     * @see InputStream#mark
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
    public AudioFileFormat getAudioFileFormat(InputStream stream) throws UnsupportedAudioFileException, IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
        // fix for 4489272: AudioSystem.getAudioFileFormat() fails for InputStream, but works for URL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
        AudioFileFormat aff = getCOMM(stream, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
        // the following is not strictly necessary - but was implemented like that in 1.3.0 - 1.4.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
        // so I leave it as it was. May remove this for 1.5.0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
        stream.reset();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
        return aff;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
     * Obtains the audio file format of the URL provided.  The URL must
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     * point to valid audio file data.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     * @param url the URL from which file format information should be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     * extracted
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     * @return an <code>AudioFileFormat</code> object describing the audio file format
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
     * @throws UnsupportedAudioFileException if the URL does not point to valid audio
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     * file data recognized by the system
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
     * @throws IOException if an I/O exception occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
    public AudioFileFormat getAudioFileFormat(URL url) throws UnsupportedAudioFileException, IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
        AudioFileFormat fileFormat = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
        InputStream urlStream = url.openStream();       // throws IOException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
            fileFormat = getCOMM(urlStream, false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
        } finally {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
            urlStream.close();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
        return fileFormat;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     * Obtains the audio file format of the File provided.  The File must
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     * point to valid audio file data.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     * @param file the File from which file format information should be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     * extracted
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     * @return an <code>AudioFileFormat</code> object describing the audio file format
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     * @throws UnsupportedAudioFileException if the File does not point to valid audio
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     * file data recognized by the system
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     * @throws IOException if an I/O exception occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
    public AudioFileFormat getAudioFileFormat(File file) throws UnsupportedAudioFileException, IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
        AudioFileFormat fileFormat = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
        FileInputStream fis = new FileInputStream(file);       // throws IOException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
        // part of fix for 4325421
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
            fileFormat = getCOMM(fis, false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
        } finally {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
            fis.close();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
        return fileFormat;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     * Obtains an audio stream from the input stream provided.  The stream must
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
     * point to valid audio file data.  In general, audio file providers may
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     * need to read some data from the stream before determining whether they
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
     * support it.  These parsers must
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
     * be able to mark the stream, read enough data to determine whether they
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
     * support the stream, and, if not, reset the stream's read pointer to its original
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
     * position.  If the input stream does not support this, this method may fail
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     * with an IOException.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     * @param stream the input stream from which the <code>AudioInputStream</code> should be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
     * constructed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
     * @return an <code>AudioInputStream</code> object based on the audio file data contained
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
     * in the input stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
     * @throws UnsupportedAudioFileException if the stream does not point to valid audio
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
     * file data recognized by the system
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
     * @throws IOException if an I/O exception occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
     * @see InputStream#markSupported
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
     * @see InputStream#mark
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
    public AudioInputStream getAudioInputStream(InputStream stream) throws UnsupportedAudioFileException, IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
        // getCOMM leaves the input stream at the beginning of the audio data
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
        AudioFileFormat fileFormat = getCOMM(stream, true);     // throws UnsupportedAudioFileException, IOException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
        // we've got everything, and the stream is at the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
        // beginning of the audio data, so return an AudioInputStream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
        return new AudioInputStream(stream, fileFormat.getFormat(), fileFormat.getFrameLength());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
     * Obtains an audio stream from the URL provided.  The URL must
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     * point to valid audio file data.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
     * @param url the URL for which the <code>AudioInputStream</code> should be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
     * constructed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     * @return an <code>AudioInputStream</code> object based on the audio file data pointed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
     * to by the URL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
     * @throws UnsupportedAudioFileException if the URL does not point to valid audio
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
     * file data recognized by the system
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     * @throws IOException if an I/O exception occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
    public AudioInputStream getAudioInputStream(URL url) throws UnsupportedAudioFileException, IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
        InputStream urlStream = url.openStream();  // throws IOException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
        AudioFileFormat fileFormat = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
            fileFormat = getCOMM(urlStream, false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
        } finally {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
            if (fileFormat == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
                urlStream.close();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
        return new AudioInputStream(urlStream, fileFormat.getFormat(), fileFormat.getFrameLength());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
     * Obtains an audio stream from the File provided.  The File must
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
     * point to valid audio file data.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
     * @param file the File for which the <code>AudioInputStream</code> should be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
     * constructed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
     * @return an <code>AudioInputStream</code> object based on the audio file data pointed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
     * to by the File
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
     * @throws UnsupportedAudioFileException if the File does not point to valid audio
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
     * file data recognized by the system
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
     * @throws IOException if an I/O exception occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
    public AudioInputStream getAudioInputStream(File file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
        throws UnsupportedAudioFileException, IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
        FileInputStream fis = new FileInputStream(file); // throws IOException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
        AudioFileFormat fileFormat = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
        // part of fix for 4325421
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
            fileFormat = getCOMM(fis, false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
        } finally {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
            if (fileFormat == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
                fis.close();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
        return new AudioInputStream(fis, fileFormat.getFormat(), fileFormat.getFrameLength());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
    //--------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
    private AudioFileFormat getCOMM(InputStream is, boolean doReset)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
        throws UnsupportedAudioFileException, IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
        DataInputStream dis = new DataInputStream(is);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
        if (doReset) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
            dis.mark(MAX_READ_LENGTH);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
        // assumes a stream at the beginning of the file which has already
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
        // passed the magic number test...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
        // leaves the input stream at the beginning of the audio data
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
        int fileRead = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
        int dataLength = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
        AudioFormat format = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
        // Read the magic number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
        int magic = dis.readInt();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
        // $$fb: fix for 4369044: javax.sound.sampled.AudioSystem.getAudioInputStream() works wrong with Cp037
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
        if (magic != AiffFileFormat.AIFF_MAGIC) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
            // not AIFF, throw exception
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
            if (doReset) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
                dis.reset();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
            throw new UnsupportedAudioFileException("not an AIFF file");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
        int length = dis.readInt();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
        int iffType = dis.readInt();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
        fileRead += 12;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
        int totallength;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
        if(length <= 0 ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
            length = AudioSystem.NOT_SPECIFIED;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
            totallength = AudioSystem.NOT_SPECIFIED;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
            totallength = length + 8;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
        // Is this an AIFC or just plain AIFF file.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
        boolean aifc = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
        // $$fb: fix for 4369044: javax.sound.sampled.AudioSystem.getAudioInputStream() works wrong with Cp037
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
        if (iffType ==  AiffFileFormat.AIFC_MAGIC) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
            aifc = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
        // Loop through the AIFF chunks until
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
        // we get to the SSND chunk.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
        boolean ssndFound = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
        while (!ssndFound) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
            // Read the chunk name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
            int chunkName = dis.readInt();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
            int chunkLen = dis.readInt();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
            fileRead += 8;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
            int chunkRead = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
            // Switch on the chunk name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
            switch (chunkName) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
            case AiffFileFormat.FVER_MAGIC:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
                // Ignore format version for now.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
                break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
            case AiffFileFormat.COMM_MAGIC:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
                // AIFF vs. AIFC
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
                // $$fb: fix for 4399551: Repost of bug candidate: cannot replay aif file (Review ID: 108108)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
                if ((!aifc && chunkLen < 18) || (aifc && chunkLen < 22)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
                    throw new UnsupportedAudioFileException("Invalid AIFF/COMM chunksize");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
                // Read header info.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
                int channels = dis.readShort();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
                dis.readInt();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
                int sampleSizeInBits = dis.readShort();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
                float sampleRate = (float) read_ieee_extended(dis);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
                chunkRead += (2 + 4 + 2 + 10);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
                // If this is not AIFC then we assume it's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
                // a linearly encoded file.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
                AudioFormat.Encoding encoding = AudioFormat.Encoding.PCM_SIGNED;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
                if (aifc) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
                    int enc = dis.readInt(); chunkRead += 4;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
                    switch (enc) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
                    case AiffFileFormat.AIFC_PCM:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
                        encoding = AudioFormat.Encoding.PCM_SIGNED;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
                        break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
                    case AiffFileFormat.AIFC_ULAW:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
                        encoding = AudioFormat.Encoding.ULAW;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
                        sampleSizeInBits = 8; // Java Sound convention
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
                        break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
                    default:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
                        throw new UnsupportedAudioFileException("Invalid AIFF encoding");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
                int frameSize = calculatePCMFrameSize(sampleSizeInBits, channels);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
                //$fb what's that ??
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
                //if (sampleSizeInBits == 8) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
                //    encoding = AudioFormat.Encoding.PCM_SIGNED;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
                //}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
                format =  new AudioFormat(encoding, sampleRate,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
                                          sampleSizeInBits, channels,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
                                          frameSize, sampleRate, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
                break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
            case AiffFileFormat.SSND_MAGIC:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
                // Data chunk.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
                // we are getting *weird* numbers for chunkLen sometimes;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
                // this really should be the size of the data chunk....
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
                int dataOffset = dis.readInt();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
                int blocksize = dis.readInt();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
                chunkRead += 8;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
                // okay, now we are done reading the header.  we need to set the size
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
                // of the data segment.  we know that sometimes the value we get for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
                // the chunksize is absurd.  this is the best i can think of:if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
                // value seems okay, use it.  otherwise, we get our value of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
                // length by assuming that everything left is the data segment;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
                // its length should be our original length (for all AIFF data chunks)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
                // minus what we've read so far.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
                // $$kk: we should be able to get length for the data chunk right after
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
                // we find "SSND."  however, some aiff files give *weird* numbers.  what
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
                // is going on??
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
                if (chunkLen < length) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
                    dataLength = chunkLen - chunkRead;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
                } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
                    // $$kk: 11.03.98: this seems dangerous!
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
                    dataLength = length - (fileRead + chunkRead);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
                ssndFound = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
                break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
            } // switch
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
            fileRead += chunkRead;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
            // skip the remainder of this chunk
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
            if (!ssndFound) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
                int toSkip = chunkLen - chunkRead;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
                if (toSkip > 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
                    fileRead += dis.skipBytes(toSkip);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
        } // while
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
        if (format == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
            throw new UnsupportedAudioFileException("missing COMM chunk");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
        AudioFileFormat.Type type = aifc?AudioFileFormat.Type.AIFC:AudioFileFormat.Type.AIFF;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
        return new AiffFileFormat(type, totallength, format, dataLength / format.getFrameSize());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
    // HELPER METHODS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
    /** write_ieee_extended(DataOutputStream dos, double f) throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
     * Extended precision IEEE floating-point conversion routine.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
     * @argument DataOutputStream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
     * @argument double
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
     * @return void
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
     * @exception IOException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
    private void write_ieee_extended(DataOutputStream dos, double f) throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
        int exponent = 16398;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
        double highMantissa = f;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
        // For now write the integer portion of f
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
        // $$jb: 03.30.99: stay in synch with JMF on this!!!!
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
        while (highMantissa < 44000) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
            highMantissa *= 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
            exponent--;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
        dos.writeShort(exponent);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
        dos.writeInt( ((int) highMantissa) << 16);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
        dos.writeInt(0); // low Mantissa
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
     * read_ieee_extended
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
     * Extended precision IEEE floating-point conversion routine.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
     * @argument DataInputStream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
     * @return double
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
     * @exception IOException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
    private double read_ieee_extended(DataInputStream dis) throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
        double f = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
        int expon = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
        long hiMant = 0, loMant = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
        long t1, t2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
        double HUGE = ((double)3.40282346638528860e+38);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
        expon = dis.readUnsignedShort();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
        t1 = (long)dis.readUnsignedShort();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
        t2 = (long)dis.readUnsignedShort();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
        hiMant = t1 << 16 | t2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
        t1 = (long)dis.readUnsignedShort();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
        t2 = (long)dis.readUnsignedShort();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
        loMant = t1 << 16 | t2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
        if (expon == 0 && hiMant == 0 && loMant == 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
            f = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
            if (expon == 0x7FFF)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
                f = HUGE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
            else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
                expon -= 16383;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
                expon -= 31;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
                f = (hiMant * Math.pow(2, expon));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
                expon -= 32;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
                f += (loMant * Math.pow(2, expon));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
        return f;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
}