We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
toCharBuffer
1 parent a3969c0 commit 03885dfCopy full SHA for 03885df
core/shared/src/main/scala/fs2/Chunk.scala
@@ -331,7 +331,7 @@ abstract class Chunk[+O] extends Serializable with ChunkPlatform[O] with ChunkRu
331
case c: Chunk.ArraySlice[_] if c.values.isInstanceOf[Array[Char]] =>
332
JCharBuffer.wrap(c.values.asInstanceOf[Array[Char]], c.offset, c.length)
333
case c: Chunk.CharBuffer =>
334
- val b = c.buf.asReadOnlyBuffer
+ val b = c.buf.duplicate // share contents, independent position/limit
335
if (c.offset == 0 && b.position() == 0 && c.size == b.limit()) b
336
else {
337
(b: JBuffer).position(c.offset.toInt)
0 commit comments