Protecting stream and handle abstract classes