add remainingBytes, isEmpty