Replace nextBytesEqual method with stream reader