28 import javax.sound.sampled.AudioSystem; 29 import javax.sound.sampled.UnsupportedAudioFileException; 30 31 /** 32 * @test 33 * @bug 8133677 34 * @summary Subsequent read from the same stream should work 35 */ 36 public final class RepeatedFormatReader { 37 38 // Stubs 39 40 private static byte[] headerMIDI = {0x4d, 0x54, 0x68, 0x64, // MThd 41 0, 0, 0, 6, // read header length 42 0, 0, // type 43 0, 0, // numtracks 44 0, 1, // timing 45 }; 46 47 private static byte[] headerAU = {0x2e, 0x73, 0x6e, 0x64, // AU_SUN_MAGIC 48 0, 0, 0, 0, // headerSize 49 0, 0, 0, 0, // dataSize 50 0, 0, 0, 1, // encoding 51 0, 0, 0, 0, // sampleRate 52 0, 0, 0, 1 // channels 53 }; 54 55 private static byte[] headerWAV = {0x52, 0x49, 0x46, 0x46, // RIFF_MAGIC 56 1, 1, 1, 1, // fileLength 57 0x57, 0x41, 0x56, 0x45, // waveMagic 58 0x66, 0x6d, 0x74, 0x20, // FMT_MAGIC 59 3, 0, 0, 0, // length 60 1, 0, // wav_type WAVE_FORMAT_PCM 61 0, 1, // channels 62 0, 0, 0, 0, // sampleRate 63 0, 0, 0, 0, // avgBytesPerSec 64 0, 0, // blockAlign 65 1, 0, // sampleSizeInBits 66 0x64, 0x61, 0x74, 0x61, // DATA_MAGIC 67 0, 0, 0, 0, // dataLength 68 }; 69 70 private static final byte[][] data = {headerMIDI, headerAU, headerWAV}; 71 | 28 import javax.sound.sampled.AudioSystem; 29 import javax.sound.sampled.UnsupportedAudioFileException; 30 31 /** 32 * @test 33 * @bug 8133677 34 * @summary Subsequent read from the same stream should work 35 */ 36 public final class RepeatedFormatReader { 37 38 // Stubs 39 40 private static byte[] headerMIDI = {0x4d, 0x54, 0x68, 0x64, // MThd 41 0, 0, 0, 6, // read header length 42 0, 0, // type 43 0, 0, // numtracks 44 0, 1, // timing 45 }; 46 47 private static byte[] headerAU = {0x2e, 0x73, 0x6e, 0x64, // AU_SUN_MAGIC 48 0, 0, 0, 24, // headerSize 49 0, 0, 0, 0, // dataSize 50 0, 0, 0, 1, // encoding 51 0, 0, 0, 1, // sampleRate 52 0, 0, 0, 1 // channels 53 }; 54 55 private static byte[] headerWAV = {0x52, 0x49, 0x46, 0x46, // RIFF_MAGIC 56 1, 1, 1, 1, // fileLength 57 0x57, 0x41, 0x56, 0x45, // waveMagic 58 0x66, 0x6d, 0x74, 0x20, // FMT_MAGIC 59 3, 0, 0, 0, // length 60 1, 0, // wav_type WAVE_FORMAT_PCM 61 0, 1, // channels 62 0, 0, 0, 0, // sampleRate 63 0, 0, 0, 0, // avgBytesPerSec 64 0, 0, // blockAlign 65 1, 0, // sampleSizeInBits 66 0x64, 0x61, 0x74, 0x61, // DATA_MAGIC 67 0, 0, 0, 0, // dataLength 68 }; 69 70 private static final byte[][] data = {headerMIDI, headerAU, headerWAV}; 71 |