Fix problems with streams. Need to move to the NIO 2 classes.