Skip to content

Commit 5171a28

Browse files
committed
Clarify copyTo behavior in the documentation
1 parent 2b7eb60 commit 5171a28

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

core/common/src/Buffer.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ public class Buffer : Source, Sink {
205205

206206
/**
207207
* Copy bytes from this buffer's subrange starting at [startIndex] and ending at [endIndex], to [out] buffer.
208+
* This method does not consume data from the buffer.
208209
*
209210
* @param out the destination buffer to copy data into.
210211
* @param startIndex the index (inclusive) of the first byte of data in this buffer to copy,

core/jvm/src/BufferExtJvm.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ public fun Buffer.readTo(out: OutputStream, byteCount: Long = size) {
105105
}
106106

107107
/**
108-
* Copy bytes from this buffer's subrange, starting at [startIndex] and ending at [endIndex], to [out].
108+
* Copy bytes from this buffer's subrange, starting at [startIndex] and ending at [endIndex], to [out]. This method
109+
* does not consume data from the buffer.
109110
*
110111
* @param out the destination to copy data into.
111112
* @param startIndex the index (inclusive) of the first byte to copy, `0` by default.

0 commit comments

Comments
 (0)