changed to include readBytes, writeBytes