mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 14:24:46 +02:00
8306308: (ch) Writer created by Channels::newWriter may lose data
Reviewed-by: djelinski, alanb
This commit is contained in:
parent
77b2394c46
commit
a1a62d9964
3 changed files with 117 additions and 35 deletions
|
@ -541,7 +541,9 @@ public final class Channels {
|
|||
int minBufferCap)
|
||||
{
|
||||
Objects.requireNonNull(ch, "ch");
|
||||
return StreamEncoder.forEncoder(ch, enc.reset(), minBufferCap);
|
||||
Objects.requireNonNull(enc, "enc");
|
||||
OutputStream out = newOutputStream(ch);
|
||||
return StreamEncoder.forOutputStreamWriter(out, enc.reset());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue