servicetalk icon indicating copy to clipboard operation
servicetalk copied to clipboard

BufferInputStream should support mark/reset

Open idelpivnitskiy opened this issue 3 years ago • 2 comments

BufferInputStream does not implement mark/reset methods of the InputStream, while we can. We should implement it to make it close to ByteArrayInputStream and ByteBufInputStream (from netty) behavior.

idelpivnitskiy avatar May 14 '21 04:05 idelpivnitskiy

@idelpivnitskiy can i work on this issue, i see that the class src/main/java/io/servicetalk/buffer/api/BufferInputStream.java, has to implement mar and reset methods. can you also add the expectation of the method implementation, what should it essentially do.

SivaTharun avatar May 16 '21 17:05 SivaTharun

Thank you for the interest @SivaTharun! Absolutely, you can take it.

The goal is to implement the standard behavior of mark/reset methods defined by Java community in InputStream javadoc. You can refer to java.io.ByteArrayInputStream and io.netty.buffer.ByteBufInputStream to get the basic idea of the implementation. Please, also add tests to verify new behavior.

idelpivnitskiy avatar May 17 '21 18:05 idelpivnitskiy