It is good programming practice to close input streams when you are finished reading from them. You close input streams with the same sort of statement that you use to close output streams:
cylinder_stream.close ( );