Skip to content

Commit a70eae1

Browse files
committed
Improve comments
1 parent 3b705d9 commit a70eae1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ private void flushBuffer() throws IOException {
115115

116116
/**
117117
* Grow buf to fit an additional len bytes if needed.
118-
* A no-op if the buffer is not resizable.
118+
* If possible, it grows by len+1 to avoid flushing when len bytes
119+
* are added. A no-op if the buffer is not resizable.
119120
*/
120121
private void growIfNeeded(int len) {
121122
if (maxBufSize > 0) {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ private void ensureOpen() throws IOException {
126126

127127
/**
128128
* Grow char array to fit an additional len characters if needed.
129-
* If possible, it grows by len+1 to reduce the need to flush.
129+
* If possible, it grows by len+1 to avoid flushing when len chars
130+
* are added.
130131
*/
131132
private void growIfNeeded(int len) {
132133
int neededSize = nextChar + len + 1;

0 commit comments

Comments
 (0)