Skip to content

Commit 57798dd

Browse files
author
Brian Burkhalter
committed
6595142: (spec) ByteArrayInputStream treats bytes, not characters
Reviewed-by: alanb
1 parent 880f52f commit 57798dd

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public class BufferedInputStream extends FilterInputStream {
9696

9797
/**
9898
* The current position in the buffer. This is the index of the next
99-
* character to be read from the {@code buf} array.
99+
* byte to be read from the {@code buf} array.
100100
* <p>
101101
* This value is always in the range {@code 0}
102102
* through {@code count}. If it is less
@@ -297,7 +297,7 @@ private int implRead() throws IOException {
297297
}
298298

299299
/**
300-
* Read characters into a portion of an array, reading from the underlying
300+
* Read bytes into a portion of an array, reading from the underlying
301301
* stream at most once if necessary.
302302
*/
303303
private int read1(byte[] b, int off, int len) throws IOException {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public class ByteArrayInputStream extends InputStream {
5656
protected byte[] buf;
5757

5858
/**
59-
* The index of the next character to read from the input stream buffer.
59+
* The index of the next byte to read from the input stream buffer.
6060
* This value should always be nonnegative
6161
* and not larger than the value of {@code count}.
6262
* The next byte to be read from the input stream buffer
@@ -80,7 +80,7 @@ public class ByteArrayInputStream extends InputStream {
8080
protected int mark = 0;
8181

8282
/**
83-
* The index one greater than the last valid character in the input
83+
* The index one greater than the last valid byte in the input
8484
* stream buffer.
8585
* This value should always be nonnegative
8686
* and not larger than the length of {@code buf}.

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1994, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1994, 2023, 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
@@ -134,7 +134,7 @@ public int available() throws IOException {
134134
* {@inheritDoc}
135135
* <p>
136136
* This method
137-
* tries to read one character from the current substream. If it
137+
* tries to read one byte from the current substream. If it
138138
* reaches the end of the stream, it calls the {@code close}
139139
* method of the current substream and begins reading from the next
140140
* substream.
@@ -163,7 +163,7 @@ public int read() throws IOException {
163163
* <p>
164164
* The {@code read} method of {@code SequenceInputStream}
165165
* tries to read the data from the current substream. If it fails to
166-
* read any characters because the substream has reached the end of
166+
* read any bytes because the substream has reached the end of
167167
* the stream, it calls the {@code close} method of the current
168168
* substream and begins reading from the next substream.
169169
*

0 commit comments

Comments
 (0)