Skip to content

Commit f472fca

Browse files
committed
java.io.BufferedWriter utilizes java.lang.CharSequence.getChars
1 parent 0f934c6 commit f472fca

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/java.base/share/classes/java/io/BufferedWriter.java

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1996, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1996, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -269,13 +269,18 @@ public void write(char[] cbuf, int off, int len) throws IOException {
269269
* @throws IOException If an I/O error occurs
270270
*/
271271
public void write(String s, int off, int len) throws IOException {
272+
super.write(s, off, len);
273+
}
274+
275+
@Override
276+
void implWrite(CharSequence csq, int off, int len) throws IOException {
272277
synchronized (lock) {
273278
ensureOpen();
274279
growIfNeeded(len);
275280
int b = off, t = off + len;
276281
while (b < t) {
277282
int d = min(nChars - nextChar, t - b);
278-
s.getChars(b, b + d, cb, nextChar);
283+
csq.getChars(b, b + d, cb, nextChar);
279284
b += d;
280285
nextChar += d;
281286
if (nextChar >= nChars)

0 commit comments

Comments
 (0)