jdk/src/share/classes/com/sun/media/sound/SunFileWriter.java
author ohair
Wed, 06 Apr 2011 22:06:11 -0700
changeset 9035 1255eb81cc2f
parent 8525 08f98f5a11df
child 18215 b2afd66ce6db
permissions -rw-r--r--
7033660: Update copyright year to 2011 on any files changed in 2011 Reviewed-by: dholmes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
9035
1255eb81cc2f 7033660: Update copyright year to 2011 on any files changed in 2011
ohair
parents: 8525
diff changeset
     2
 * Copyright (c) 1999, 2011, 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
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    public AudioFileFormat.Type[] getAudioFileTypes(){
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
        AudioFileFormat.Type[] localArray = new AudioFileFormat.Type[types.length];
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
        System.arraycopy(types, 0, localArray, 0, types.length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
        return localArray;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    public abstract AudioFileFormat.Type[] getAudioFileTypes(AudioInputStream stream);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    public abstract int write(AudioInputStream stream, AudioFileFormat.Type fileType, OutputStream out) throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
    public abstract int write(AudioInputStream stream, AudioFileFormat.Type fileType, File out) throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
    // HELPER METHODS
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * rllong
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     * Protected helper method to read 64 bits and changing the order of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     * each bytes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     * @param DataInputStream
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     * @return 32 bits swapped value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     * @exception IOException
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
    protected int rllong(DataInputStream dis) throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
        int b1, b2, b3, b4 ;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
        int i = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
        i = dis.readInt();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
        b1 = ( i & 0xFF ) << 24 ;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
        b2 = ( i & 0xFF00 ) << 8;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
        b3 = ( i & 0xFF0000 ) >> 8;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
        b4 = ( i & 0xFF000000 ) >>> 24;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
        i = ( b1 | b2 | b3 | b4 );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
        return i;
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
     * big2little
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     * Protected helper method to swap the order of bytes in a 32 bit int
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     * @param int
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
     * @return 32 bits swapped value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
    protected int big2little(int i) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
        int b1, b2, b3, b4 ;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
        b1 = ( i & 0xFF ) << 24 ;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
        b2 = ( i & 0xFF00 ) << 8;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
        b3 = ( i & 0xFF0000 ) >> 8;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
        b4 = ( i & 0xFF000000 ) >>> 24;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
        i = ( b1 | b2 | b3 | b4 );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
        return i;
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
     * rlshort
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     * Protected helper method to read 16 bits value. Swap high with low byte.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     * @param DataInputStream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     * @return the swapped value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     * @exception IOException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
    protected short rlshort(DataInputStream dis)  throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
        short s=0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
        short high, low;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
        s = dis.readShort();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
        high = (short)(( s & 0xFF ) << 8) ;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
        low = (short)(( s & 0xFF00 ) >>> 8);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
        s = (short)( high | low );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
        return s;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     * big2little
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     * Protected helper method to swap the order of bytes in a 16 bit short
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     * @param int
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     * @return 16 bits swapped value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
    protected short big2littleShort(short i) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
        short high, low;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
        high = (short)(( i & 0xFF ) << 8) ;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
        low = (short)(( i & 0xFF00 ) >>> 8);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
        i = (short)( high | low );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
        return i;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
8525
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   175
    /**
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   176
     * 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
   177
     * 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
   178
     * closing of the source input streams.
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   179
     */
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   180
    protected class NoCloseInputStream extends InputStream {
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   181
        private final InputStream in;
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   182
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   183
        public NoCloseInputStream(InputStream in) {
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   184
            this.in = in;
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
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   187
        @Override
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   188
        public int read() throws IOException {
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   189
            return in.read();
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
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   192
        @Override
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   193
        public int read(byte b[]) throws IOException {
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   194
            return in.read(b);
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
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   197
        @Override
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   198
        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
   199
            return in.read(b, off, len);
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
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   202
        @Override
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   203
        public long skip(long n) throws IOException {
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   204
            return in.skip(n);
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
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   207
        @Override
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   208
        public int available() throws IOException {
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   209
            return in.available();
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
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   212
        @Override
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   213
        public void close() throws IOException {
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   214
            // don't propagate the call
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
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   217
        @Override
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   218
        public void mark(int readlimit) {
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   219
            in.mark(readlimit);
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
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   222
        @Override
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   223
        public void reset() throws IOException {
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   224
            in.reset();
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
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   227
        @Override
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   228
        public boolean markSupported() {
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   229
            return in.markSupported();
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
08f98f5a11df 7013521: AudioSystem.write for AIFF files closes source audio stream
amenkov
parents: 5506
diff changeset
   232
    }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
}