jdk/src/share/classes/com/sun/media/sound/SunFileWriter.java
author darcy
Mon, 05 May 2014 23:19:00 -0700
changeset 24548 9c007a986347
parent 18215 b2afd66ce6db
permissions -rw-r--r--
8042256: Fix raw and unchecked lint warnings in com.sun.media.sound Reviewed-by: prr
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
18215
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 9035
diff changeset
     2
 * Copyright (c) 1999, 2013, 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.io.File;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.io.InputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.io.OutputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.io.IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import java.io.DataInputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import javax.sound.sampled.AudioFileFormat;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import javax.sound.sampled.AudioInputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import javax.sound.sampled.spi.AudioFileWriter;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
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
 * Abstract File Writer class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * @author Jan Borgersen
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
abstract class SunFileWriter extends AudioFileWriter {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
    // buffer size for write
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
    protected static final int bufferSize = 16384;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
    // buffer size for temporary input streams
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
    protected static final int bisBufferSize = 4096;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
    final AudioFileFormat.Type types[];
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
     * Constructs a new SunParser object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    SunFileWriter(AudioFileFormat.Type types[]) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
        this.types = types;
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
    // METHODS TO IMPLEMENT AudioFileWriter
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    // new, 10.27.99
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
18215
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 9035
diff changeset
    72
    public final AudioFileFormat.Type[] getAudioFileTypes(){
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
        AudioFileFormat.Type[] localArray = new AudioFileFormat.Type[types.length];
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
        System.arraycopy(types, 0, localArray, 0, types.length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
        return localArray;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
    public abstract AudioFileFormat.Type[] getAudioFileTypes(AudioInputStream stream);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
    public abstract int write(AudioInputStream stream, AudioFileFormat.Type fileType, OutputStream out) throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    public abstract int write(AudioInputStream stream, AudioFileFormat.Type fileType, File out) throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
    // HELPER METHODS
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     * rllong
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * Protected helper method to read 64 bits and changing the order of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     * each bytes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     * @param DataInputStream
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     * @return 32 bits swapped value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     * @exception IOException
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     */
18215
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 9035
diff changeset
    97
    final int rllong(DataInputStream dis) throws IOException {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
        int b1, b2, b3, b4 ;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
        int i = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
        i = dis.readInt();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
        b1 = ( i & 0xFF ) << 24 ;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
        b2 = ( i & 0xFF00 ) << 8;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
        b3 = ( i & 0xFF0000 ) >> 8;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
        b4 = ( i & 0xFF000000 ) >>> 24;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
        i = ( b1 | b2 | b3 | b4 );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
        return i;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     * big2little
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     * Protected helper method to swap the order of bytes in a 32 bit int
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     * @param int
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     * @return 32 bits swapped value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
     */
18215
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 9035
diff changeset
   120
    final int big2little(int i) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
        int b1, b2, b3, b4 ;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
        b1 = ( i & 0xFF ) << 24 ;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
        b2 = ( i & 0xFF00 ) << 8;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
        b3 = ( i & 0xFF0000 ) >> 8;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
        b4 = ( i & 0xFF000000 ) >>> 24;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
        i = ( b1 | b2 | b3 | b4 );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
        return i;
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
     * rlshort
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     * Protected helper method to read 16 bits value. Swap high with low byte.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     * @param DataInputStream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     * @return the swapped value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     * @exception IOException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     */
18215
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 9035
diff changeset
   141
    final short rlshort(DataInputStream dis)  throws IOException {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
        short s=0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
        short high, low;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
        s = dis.readShort();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
        high = (short)(( s & 0xFF ) << 8) ;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
        low = (short)(( s & 0xFF00 ) >>> 8);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
        s = (short)( high | low );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
        return s;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     * big2little
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     * Protected helper method to swap the order of bytes in a 16 bit short
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     * @param int
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     * @return 16 bits swapped value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     */
18215
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 9035
diff changeset
   162
    final short big2littleShort(short i) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
        short high, low;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
        high = (short)(( i & 0xFF ) << 8) ;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
        low = (short)(( i & 0xFF00 ) >>> 8);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
        i = (short)( high | low );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
        return i;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
8525
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   174
    /**
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   175
     * InputStream wrapper class which prevent source stream from being closed.
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   176
     * The class is usefull for use with SequenceInputStream to prevent
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   177
     * closing of the source input streams.
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   178
     */
18215
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 9035
diff changeset
   179
    final class NoCloseInputStream extends InputStream {
8525
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   180
        private final InputStream in;
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   181
18215
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 9035
diff changeset
   182
        NoCloseInputStream(InputStream in) {
8525
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   183
            this.in = in;
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   184
        }
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   185
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   186
        @Override
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   187
        public int read() throws IOException {
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   188
            return in.read();
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   189
        }
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   190
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   191
        @Override
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   192
        public int read(byte b[]) throws IOException {
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   193
            return in.read(b);
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   194
        }
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   195
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   196
        @Override
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   197
        public int read(byte b[], int off, int len) throws IOException {
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   198
            return in.read(b, off, len);
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   199
        }
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   200
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   201
        @Override
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   202
        public long skip(long n) throws IOException {
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   203
            return in.skip(n);
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   204
        }
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   205
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   206
        @Override
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   207
        public int available() throws IOException {
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   208
            return in.available();
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   209
        }
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   210
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   211
        @Override
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   212
        public void close() throws IOException {
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   213
            // don't propagate the call
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   214
        }
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   215
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   216
        @Override
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   217
        public void mark(int readlimit) {
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   218
            in.mark(readlimit);
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   219
        }
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   220
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   221
        @Override
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   222
        public void reset() throws IOException {
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   223
            in.reset();
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   224
        }
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   225
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   226
        @Override
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   227
        public boolean markSupported() {
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   228
            return in.markSupported();
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   229
        }
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   230
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   231
    }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
}