jdk/src/share/classes/com/sun/media/sound/Toolkit.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 javax.sound.sampled.AudioFormat;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import javax.sound.sampled.AudioInputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import javax.sound.sampled.AudioSystem;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * Common conversions etc.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * @author Kara Kytle
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * @author Florian Bomers
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
public class Toolkit {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
     * Converts bytes from signed to unsigned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
    static void getUnsigned8(byte[] b, int off, int len) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
        for (int i = off; i < (off+len); i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
            b[i] += 128;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
     * Swaps bytes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
     * @throws ArrayOutOfBoundsException if len is not a multiple of 2.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
    static void getByteSwapped(byte[] b, int off, int len) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
        byte tempByte;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
        for (int i = off; i < (off+len); i+=2) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
            tempByte = b[i];
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
            b[i] = b[i+1];
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
            b[i+1] = tempByte;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
        }
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
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
     * Linear to DB scale conversion.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    static float linearToDB(float linear) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
        float dB = (float) (Math.log((double)((linear==0.0)?0.0001:linear))/Math.log(10.0) * 20.0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
        return dB;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
     * DB to linear scale conversion.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    static float dBToLinear(float dB) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
        float linear = (float) Math.pow(10.0, dB/20.0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
        return linear;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
     * returns bytes aligned to a multiple of blocksize
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     * the return value will be in the range of (bytes-blocksize+1) ... bytes
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
    static long align(long bytes, int blockSize) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
        // prevent null pointers
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
        if (blockSize <= 1) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
            return bytes;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
        return bytes - (bytes % blockSize);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
    static int align(int bytes, int blockSize) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
        // prevent null pointers
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
        if (blockSize <= 1) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
            return bytes;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
        return bytes - (bytes % blockSize);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     * gets the number of bytes needed to play the specified number of milliseconds
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
    static long millis2bytes(AudioFormat format, long millis) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
        long result = (long) (millis * format.getFrameRate() / 1000.0f * format.getFrameSize());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
        return align(result, format.getFrameSize());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     * gets the time in milliseconds for the given number of bytes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
    static long bytes2millis(AudioFormat format, long bytes) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
        return (long) (bytes / format.getFrameRate() * 1000.0f / format.getFrameSize());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
     * gets the number of bytes needed to play the specified number of microseconds
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
    static long micros2bytes(AudioFormat format, long micros) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
        long result = (long) (micros * format.getFrameRate() / 1000000.0f * format.getFrameSize());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
        return align(result, format.getFrameSize());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
     * gets the time in microseconds for the given number of bytes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
    static long bytes2micros(AudioFormat format, long bytes) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
        return (long) (bytes / format.getFrameRate() * 1000000.0f / format.getFrameSize());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     * gets the number of frames needed to play the specified number of microseconds
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
    static long micros2frames(AudioFormat format, long micros) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
        return (long) (micros * format.getFrameRate() / 1000000.0f);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
     * gets the time in microseconds for the given number of frames
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
    static long frames2micros(AudioFormat format, long frames) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
        return (long) (((double) frames) / format.getFrameRate() * 1000000.0d);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
    static void isFullySpecifiedAudioFormat(AudioFormat format) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
        if (!format.getEncoding().equals(AudioFormat.Encoding.PCM_SIGNED)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
            && !format.getEncoding().equals(AudioFormat.Encoding.PCM_UNSIGNED)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
            && !format.getEncoding().equals(AudioFormat.Encoding.ULAW)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
            && !format.getEncoding().equals(AudioFormat.Encoding.ALAW)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
            // we don't know how to verify possibly non-linear encodings
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
            return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
        if (format.getFrameRate() <= 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
            throw new IllegalArgumentException("invalid frame rate: "
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
                                               +((format.getFrameRate()==-1)?
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
                                                 "NOT_SPECIFIED":String.valueOf(format.getFrameRate())));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
        if (format.getSampleRate() <= 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
            throw new IllegalArgumentException("invalid sample rate: "
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
                                               +((format.getSampleRate()==-1)?
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
                                                 "NOT_SPECIFIED":String.valueOf(format.getSampleRate())));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
        if (format.getSampleSizeInBits() <= 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
            throw new IllegalArgumentException("invalid sample size in bits: "
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
                                               +((format.getSampleSizeInBits()==-1)?
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
                                                 "NOT_SPECIFIED":String.valueOf(format.getSampleSizeInBits())));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
        if (format.getFrameSize() <= 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
            throw new IllegalArgumentException("invalid frame size: "
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
                                               +((format.getFrameSize()==-1)?
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
                                                 "NOT_SPECIFIED":String.valueOf(format.getFrameSize())));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
        if (format.getChannels() <= 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
            throw new IllegalArgumentException("invalid number of channels: "
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
                                               +((format.getChannels()==-1)?
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
                                                 "NOT_SPECIFIED":String.valueOf(format.getChannels())));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
    static boolean isFullySpecifiedPCMFormat(AudioFormat format) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
        if (!format.getEncoding().equals(AudioFormat.Encoding.PCM_SIGNED)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
            && !format.getEncoding().equals(AudioFormat.Encoding.PCM_UNSIGNED)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
            return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
        if ((format.getFrameRate() <= 0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
            || (format.getSampleRate() <= 0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
            || (format.getSampleSizeInBits() <= 0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
            || (format.getFrameSize() <= 0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
            || (format.getChannels() <= 0)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
            return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
        return true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
    public static AudioInputStream getPCMConvertedAudioInputStream(AudioInputStream ais) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
        // we can't open the device for non-PCM playback, so we have
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
        // convert any other encodings to PCM here (at least we try!)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
        AudioFormat af = ais.getFormat();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
        if( (!af.getEncoding().equals(AudioFormat.Encoding.PCM_SIGNED)) &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
            (!af.getEncoding().equals(AudioFormat.Encoding.PCM_UNSIGNED))) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
            try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
                AudioFormat newFormat =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
                    new AudioFormat( AudioFormat.Encoding.PCM_SIGNED,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
                                     af.getSampleRate(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
                                     16,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
                                     af.getChannels(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
                                     af.getChannels() * 2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
                                     af.getSampleRate(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
                                     Platform.isBigEndian());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
                ais = AudioSystem.getAudioInputStream(newFormat, ais);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
            } catch (Exception e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
                if (Printer.err) e.printStackTrace();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
                ais = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
        return ais;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
}