question: private void testAdvancePastNextSyncMarkerAt ( int position , int size ) throws IOException { byte sentinel = ( byte ) 0xFF ; byte [ ] marker = new byte [ ] { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , 1 , 2 , 3 , 4 , 5 , 6 } ; byte [ ] haystack = createHaystack ( marker , position , size ) ; PushbackInputStream stream = new PushbackInputStream ( new ByteArrayInputStream ( haystack ) , marker . length ) ; if ( position + marker . length < size ) { haystack [ position + marker . length ] = sentinel ; assertEquals ( position + marker . length , AvroReader . advancePastNextSyncMarker ( stream , marker ) ) ; assertEquals ( sentinel , ( byte ) stream . read ( ) ) ; } else { assertEquals ( size , AvroReader . advancePastNextSyncMarker ( stream , marker ) ) ; assertEquals ( - 1 , stream . read ( ) ) ; } }
target:  Asserts that advancePastNextSyncMarker advances an input stream past a sync marker and correctly returns the number of bytes consumed from the stream. Creates a haystack of size bytes and places a 16-byte sync marker at the position specified.