Replace hand-coded read fully loop with NB.readFully