File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
core/shared/src/main/scala/fs2 Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -306,7 +306,10 @@ abstract class Chunk[+O] extends Serializable with ChunkPlatform[O] with ChunkRu
306306 case _ => Chunk .ArraySlice (toArray, 0 , size)
307307 }
308308
309- /** Converts this chunk to a `java.nio.ByteBuffer`. */
309+ /** Converts this chunk to a `java.nio.ByteBuffer`.
310+ * @note that even "read-only" interaction with a `ByteBuffer` may increment its `position`,
311+ * so this method should be considered as unsafely allocating mutable state.
312+ */
310313 def toByteBuffer [B >: O ](implicit ev : B =:= Byte ): JByteBuffer =
311314 this match {
312315 case c : Chunk .ArraySlice [_] if c.values.isInstanceOf [Array [Byte ]] =>
@@ -325,7 +328,10 @@ abstract class Chunk[+O] extends Serializable with ChunkPlatform[O] with ChunkRu
325328 JByteBuffer .wrap(this .asInstanceOf [Chunk [Byte ]].toArray, 0 , size)
326329 }
327330
328- /** Converts this chunk to a `java.nio.CharBuffer`. */
331+ /** Converts this chunk to a `java.nio.CharBuffer`.
332+ * @note that even "read-only" interaction with a `CharBuffer` may increment its position,
333+ * so this method should be considered as unsafely allocating mutable state.
334+ */
329335 def toCharBuffer [B >: O ](implicit ev : B =:= Char ): JCharBuffer =
330336 this match {
331337 case c : Chunk .ArraySlice [_] if c.values.isInstanceOf [Array [Char ]] =>
You can’t perform that action at this time.
0 commit comments