From c7de4e2871d6a32cacc7aab69d826f3afd6301ef Mon Sep 17 00:00:00 2001 From: BenWhitehead Date: Wed, 27 Jul 2022 12:53:29 -0400 Subject: [PATCH] docs: update javadocs for ReadChannel#limit to be more clear (#880) Fixes https://github.com/googleapis/java-storage/issues/1512 --- .../src/main/java/com/google/cloud/ReadChannel.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/google-cloud-core/src/main/java/com/google/cloud/ReadChannel.java b/google-cloud-core/src/main/java/com/google/cloud/ReadChannel.java index 9a24b4e553..781326fa7a 100644 --- a/google-cloud-core/src/main/java/com/google/cloud/ReadChannel.java +++ b/google-cloud-core/src/main/java/com/google/cloud/ReadChannel.java @@ -55,9 +55,13 @@ public interface ReadChannel extends ReadableByteChannel, Closeable, Restorable< RestorableState capture(); /** - * Limit the maximum number of bytes available to be read from this channel. If the limit is + * Limit the maximum number of bytes to be read from the objects content, counting from the + * beginning of the object, which will be available to read from this channel. If the limit is * larger than the actual size of the content this will have no material impact. * + *

If used in conjunction with {@link #seek(long)} the total number of returned bytes from this + * channel will be reduced by the number of bytes specified to seek. + * *

NOTE:Implementers are not required to return a new instance from this method, however * they are allowed to. Users of this method should always use the instance returned from this * method.