Skip to content

Commit 4897930

Browse files
klueverGoogle Java Core Libraries
authored and
Google Java Core Libraries
committedApr 10, 2023
Remove @Beta from ByteStreams.
Fixes #3239 RELNOTES=`io`: Remove `@Beta` from `ByteStreams`. PiperOrigin-RevId: 523159991
1 parent 61be35c commit 4897930

File tree

2 files changed

+0
-30
lines changed

2 files changed

+0
-30
lines changed
 

‎android/guava/src/com/google/common/io/ByteStreams.java

-15
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import static java.lang.Math.max;
2222
import static java.lang.Math.min;
2323

24-
import com.google.common.annotations.Beta;
2524
import com.google.common.annotations.GwtIncompatible;
2625
import com.google.common.annotations.J2ktIncompatible;
2726
import com.google.common.math.IntMath;
@@ -285,7 +284,6 @@ static byte[] toByteArray(InputStream in, long expectedSize) throws IOException
285284
* @since 20.0
286285
*/
287286
@CanIgnoreReturnValue
288-
@Beta
289287
public static long exhaust(InputStream in) throws IOException {
290288
long total = 0;
291289
long read;
@@ -300,7 +298,6 @@ public static long exhaust(InputStream in) throws IOException {
300298
* Returns a new {@link ByteArrayDataInput} instance to read from the {@code bytes} array from the
301299
* beginning.
302300
*/
303-
@Beta
304301
public static ByteArrayDataInput newDataInput(byte[] bytes) {
305302
return newDataInput(new ByteArrayInputStream(bytes));
306303
}
@@ -312,7 +309,6 @@ public static ByteArrayDataInput newDataInput(byte[] bytes) {
312309
* @throws IndexOutOfBoundsException if {@code start} is negative or greater than the length of
313310
* the array
314311
*/
315-
@Beta
316312
public static ByteArrayDataInput newDataInput(byte[] bytes, int start) {
317313
checkPositionIndex(start, bytes.length);
318314
return newDataInput(new ByteArrayInputStream(bytes, start, bytes.length - start));
@@ -325,7 +321,6 @@ public static ByteArrayDataInput newDataInput(byte[] bytes, int start) {
325321
*
326322
* @since 17.0
327323
*/
328-
@Beta
329324
public static ByteArrayDataInput newDataInput(ByteArrayInputStream byteArrayInputStream) {
330325
return new ByteArrayDataInputStream(checkNotNull(byteArrayInputStream));
331326
}
@@ -477,7 +472,6 @@ public String readUTF() {
477472
}
478473

479474
/** Returns a new {@link ByteArrayDataOutput} instance with a default size. */
480-
@Beta
481475
public static ByteArrayDataOutput newDataOutput() {
482476
return newDataOutput(new ByteArrayOutputStream());
483477
}
@@ -488,7 +482,6 @@ public static ByteArrayDataOutput newDataOutput() {
488482
*
489483
* @throws IllegalArgumentException if {@code size} is negative
490484
*/
491-
@Beta
492485
public static ByteArrayDataOutput newDataOutput(int size) {
493486
// When called at high frequency, boxing size generates too much garbage,
494487
// so avoid doing that if we can.
@@ -510,7 +503,6 @@ public static ByteArrayDataOutput newDataOutput(int size) {
510503
*
511504
* @since 17.0
512505
*/
513-
@Beta
514506
public static ByteArrayDataOutput newDataOutput(ByteArrayOutputStream byteArrayOutputStream) {
515507
return new ByteArrayDataOutputStream(checkNotNull(byteArrayOutputStream));
516508
}
@@ -687,7 +679,6 @@ public String toString() {
687679
*
688680
* @since 14.0 (since 1.0 as com.google.common.io.NullOutputStream)
689681
*/
690-
@Beta
691682
public static OutputStream nullOutputStream() {
692683
return NULL_OUTPUT_STREAM;
693684
}
@@ -700,7 +691,6 @@ public static OutputStream nullOutputStream() {
700691
* @return a length-limited {@link InputStream}
701692
* @since 14.0 (since 1.0 as com.google.common.io.LimitInputStream)
702693
*/
703-
@Beta
704694
public static InputStream limit(InputStream in, long limit) {
705695
return new LimitedInputStream(in, limit);
706696
}
@@ -787,7 +777,6 @@ public long skip(long n) throws IOException {
787777
* @throws EOFException if this stream reaches the end before reading all the bytes.
788778
* @throws IOException if an I/O error occurs.
789779
*/
790-
@Beta
791780
public static void readFully(InputStream in, byte[] b) throws IOException {
792781
readFully(in, b, 0, b.length);
793782
}
@@ -804,7 +793,6 @@ public static void readFully(InputStream in, byte[] b) throws IOException {
804793
* @throws EOFException if this stream reaches the end before reading all the bytes.
805794
* @throws IOException if an I/O error occurs.
806795
*/
807-
@Beta
808796
public static void readFully(InputStream in, byte[] b, int off, int len) throws IOException {
809797
int read = read(in, b, off, len);
810798
if (read != len) {
@@ -822,7 +810,6 @@ public static void readFully(InputStream in, byte[] b, int off, int len) throws
822810
* @throws EOFException if this stream reaches the end before skipping all the bytes
823811
* @throws IOException if an I/O error occurs, or the stream does not support skipping
824812
*/
825-
@Beta
826813
public static void skipFully(InputStream in, long n) throws IOException {
827814
long skipped = skipUpTo(in, n);
828815
if (skipped < n) {
@@ -888,7 +875,6 @@ private static long skipSafely(InputStream in, long n) throws IOException {
888875
* @throws IOException if an I/O error occurs
889876
* @since 14.0
890877
*/
891-
@Beta
892878
@CanIgnoreReturnValue // some processors won't return a useful result
893879
@ParametricNullness
894880
public static <T extends @Nullable Object> T readBytes(
@@ -928,7 +914,6 @@ private static long skipSafely(InputStream in, long n) throws IOException {
928914
* @throws IndexOutOfBoundsException if {@code off} is negative, if {@code len} is negative, or if
929915
* {@code off + len} is greater than {@code b.length}
930916
*/
931-
@Beta
932917
@CanIgnoreReturnValue
933918
// Sometimes you don't care how many bytes you actually read, I guess.
934919
// (You know that it's either going to read len bytes or stop at EOF.)

‎guava/src/com/google/common/io/ByteStreams.java

-15
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import static java.lang.Math.max;
2222
import static java.lang.Math.min;
2323

24-
import com.google.common.annotations.Beta;
2524
import com.google.common.annotations.GwtIncompatible;
2625
import com.google.common.annotations.J2ktIncompatible;
2726
import com.google.common.math.IntMath;
@@ -285,7 +284,6 @@ static byte[] toByteArray(InputStream in, long expectedSize) throws IOException
285284
* @since 20.0
286285
*/
287286
@CanIgnoreReturnValue
288-
@Beta
289287
public static long exhaust(InputStream in) throws IOException {
290288
long total = 0;
291289
long read;
@@ -300,7 +298,6 @@ public static long exhaust(InputStream in) throws IOException {
300298
* Returns a new {@link ByteArrayDataInput} instance to read from the {@code bytes} array from the
301299
* beginning.
302300
*/
303-
@Beta
304301
public static ByteArrayDataInput newDataInput(byte[] bytes) {
305302
return newDataInput(new ByteArrayInputStream(bytes));
306303
}
@@ -312,7 +309,6 @@ public static ByteArrayDataInput newDataInput(byte[] bytes) {
312309
* @throws IndexOutOfBoundsException if {@code start} is negative or greater than the length of
313310
* the array
314311
*/
315-
@Beta
316312
public static ByteArrayDataInput newDataInput(byte[] bytes, int start) {
317313
checkPositionIndex(start, bytes.length);
318314
return newDataInput(new ByteArrayInputStream(bytes, start, bytes.length - start));
@@ -325,7 +321,6 @@ public static ByteArrayDataInput newDataInput(byte[] bytes, int start) {
325321
*
326322
* @since 17.0
327323
*/
328-
@Beta
329324
public static ByteArrayDataInput newDataInput(ByteArrayInputStream byteArrayInputStream) {
330325
return new ByteArrayDataInputStream(checkNotNull(byteArrayInputStream));
331326
}
@@ -477,7 +472,6 @@ public String readUTF() {
477472
}
478473

479474
/** Returns a new {@link ByteArrayDataOutput} instance with a default size. */
480-
@Beta
481475
public static ByteArrayDataOutput newDataOutput() {
482476
return newDataOutput(new ByteArrayOutputStream());
483477
}
@@ -488,7 +482,6 @@ public static ByteArrayDataOutput newDataOutput() {
488482
*
489483
* @throws IllegalArgumentException if {@code size} is negative
490484
*/
491-
@Beta
492485
public static ByteArrayDataOutput newDataOutput(int size) {
493486
// When called at high frequency, boxing size generates too much garbage,
494487
// so avoid doing that if we can.
@@ -510,7 +503,6 @@ public static ByteArrayDataOutput newDataOutput(int size) {
510503
*
511504
* @since 17.0
512505
*/
513-
@Beta
514506
public static ByteArrayDataOutput newDataOutput(ByteArrayOutputStream byteArrayOutputStream) {
515507
return new ByteArrayDataOutputStream(checkNotNull(byteArrayOutputStream));
516508
}
@@ -687,7 +679,6 @@ public String toString() {
687679
*
688680
* @since 14.0 (since 1.0 as com.google.common.io.NullOutputStream)
689681
*/
690-
@Beta
691682
public static OutputStream nullOutputStream() {
692683
return NULL_OUTPUT_STREAM;
693684
}
@@ -700,7 +691,6 @@ public static OutputStream nullOutputStream() {
700691
* @return a length-limited {@link InputStream}
701692
* @since 14.0 (since 1.0 as com.google.common.io.LimitInputStream)
702693
*/
703-
@Beta
704694
public static InputStream limit(InputStream in, long limit) {
705695
return new LimitedInputStream(in, limit);
706696
}
@@ -787,7 +777,6 @@ public long skip(long n) throws IOException {
787777
* @throws EOFException if this stream reaches the end before reading all the bytes.
788778
* @throws IOException if an I/O error occurs.
789779
*/
790-
@Beta
791780
public static void readFully(InputStream in, byte[] b) throws IOException {
792781
readFully(in, b, 0, b.length);
793782
}
@@ -804,7 +793,6 @@ public static void readFully(InputStream in, byte[] b) throws IOException {
804793
* @throws EOFException if this stream reaches the end before reading all the bytes.
805794
* @throws IOException if an I/O error occurs.
806795
*/
807-
@Beta
808796
public static void readFully(InputStream in, byte[] b, int off, int len) throws IOException {
809797
int read = read(in, b, off, len);
810798
if (read != len) {
@@ -822,7 +810,6 @@ public static void readFully(InputStream in, byte[] b, int off, int len) throws
822810
* @throws EOFException if this stream reaches the end before skipping all the bytes
823811
* @throws IOException if an I/O error occurs, or the stream does not support skipping
824812
*/
825-
@Beta
826813
public static void skipFully(InputStream in, long n) throws IOException {
827814
long skipped = skipUpTo(in, n);
828815
if (skipped < n) {
@@ -888,7 +875,6 @@ private static long skipSafely(InputStream in, long n) throws IOException {
888875
* @throws IOException if an I/O error occurs
889876
* @since 14.0
890877
*/
891-
@Beta
892878
@CanIgnoreReturnValue // some processors won't return a useful result
893879
@ParametricNullness
894880
public static <T extends @Nullable Object> T readBytes(
@@ -928,7 +914,6 @@ private static long skipSafely(InputStream in, long n) throws IOException {
928914
* @throws IndexOutOfBoundsException if {@code off} is negative, if {@code len} is negative, or if
929915
* {@code off + len} is greater than {@code b.length}
930916
*/
931-
@Beta
932917
@CanIgnoreReturnValue
933918
// Sometimes you don't care how many bytes you actually read, I guess.
934919
// (You know that it's either going to read len bytes or stop at EOF.)

0 commit comments

Comments
 (0)
Please sign in to comment.