mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 10:04:42 +02:00
8262161: Refactor manual I/O stream copying in java.desktop to use new convenience APIs
Reviewed-by: serb, prr
This commit is contained in:
parent
4e9476071d
commit
39b1113838
11 changed files with 32 additions and 131 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2007, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -987,11 +987,7 @@ public final class DLSSoundbank implements Soundbank {
|
|||
RIFFWriter data_chunk = writer.writeChunk("data");
|
||||
AudioInputStream stream = AudioSystem.getAudioInputStream(
|
||||
audioformat, (AudioInputStream)sample.getData());
|
||||
byte[] buff = new byte[1024];
|
||||
int ret;
|
||||
while ((ret = stream.read(buff)) != -1) {
|
||||
data_chunk.write(buff, 0, ret);
|
||||
}
|
||||
stream.transferTo(data_chunk);
|
||||
} else {
|
||||
RIFFWriter data_chunk = writer.writeChunk("data");
|
||||
ModelByteBuffer databuff = sample.getDataBuffer();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue