private void checkConsistentReadAndIncrementPosition(Class<?> clazz, FakeEncodedItem item) {
    """
	Ensures that the next sizeBytes are all the initial value we read.
	
	<p>This detects:
	
	<ul>
	<li>Reading an item, but not starting at its start position
	<li>Reading items that were truncated by setSize
	<li>Reading items that were partially overwritten by another
	</ul>
    """
      int endPosition = dataPosition + item.sizeBytes;
      for (int i = dataPosition; i < endPosition; i++) {
        FakeEncodedItem foundItemItem = i < dataSize ? data[i] : null;
        if (foundItemItem != item) {
          throw new UnreliableBehaviorError(
              clazz,
              dataPosition,
              item,
              String.format(
                  Locale.US,
                  "but [%s] interrupts it at position %d",
                  foundItemItem == null
                      ? "uninitialized data or the end of the buffer"
                      : foundItemItem.value,
                  i));
        }
      }
      dataPosition = Math.min(dataSize, dataPosition + item.sizeBytes);
    }
private void checkConsistentReadAndIncrementPosition(Class<?> clazz, FakeEncodedItem item) {
      int endPosition = dataPosition + item.sizeBytes;
      for (int i = dataPosition; i < endPosition; i++) {
        FakeEncodedItem foundItemItem = i < dataSize ? data[i] : null;
        if (foundItemItem != item) {
          throw new UnreliableBehaviorError(
              clazz,
              dataPosition,
              item,
              String.format(
                  Locale.US,
                  "but [%s] interrupts it at position %d",
                  foundItemItem == null
                      ? "uninitialized data or the end of the buffer"
                      : foundItemItem.value,
                  i));
        }
      }
      dataPosition = Math.min(dataSize, dataPosition + item.sizeBytes);
    }
private void checkConsistentReadAndIncrementPosition ( Class < ? > clazz , FakeEncodedItem item ) { int endPosition = dataPosition + item . sizeBytes ; for ( int i = dataPosition ; i < endPosition ; i ++ ) { FakeEncodedItem foundItemItem = i < dataSize ? data [ i ] : null ; if ( foundItemItem != item ) { throw new UnreliableBehaviorError ( clazz , dataPosition , item , String . format ( Locale . US , "but [%s] interrupts it at position %d" , foundItemItem == null ? "uninitialized data or the end of the buffer" : foundItemItem . value , i ) ) ; } } dataPosition = Math . min ( dataSize , dataPosition + item . sizeBytes ) ; }
Ensures that the next sizeBytes are all the initial value we read.

<p>This detects:

<ul>
<li>Reading an item, but not starting at its start position
<li>Reading items that were truncated by setSize
<li>Reading items that were partially overwritten by another
</ul>
Ensures that the next sizeBytes are all the initial value we read .