The class was changed in #3219 to make it thread safe. Subsequently, in #6025 the class was marked with the @NotThreadSafe annotation, which is correct for InputStreams. AtomicInteger.weakCompareAndSetVolatile, from the AtomicInteger cursor in SeekableByteArrayInputStream.read() was noted as a hot spot in some recent profiling. I'm thinking we should revert the changes made in #3219 to just use an int for the current pointer.
The class was changed in #3219 to make it thread safe. Subsequently, in #6025 the class was marked with the
@NotThreadSafeannotation, which is correct for InputStreams.AtomicInteger.weakCompareAndSetVolatile, from theAtomicIntegercursor inSeekableByteArrayInputStream.read()was noted as a hot spot in some recent profiling. I'm thinking we should revert the changes made in #3219 to just use an int for the current pointer.