Most ships have a library of some sort and can range from pretty poor to quite nice. Most tend to have books that you just grab and replace when finished and is all on the honor system. Meaning you are not checking out a book and have to return it at such and such time. Most also have advancement and rate books to study from, but again those may be in and out, especially when an advancement test is approaching. Some bigger ships may have a more well kept library and can include computers and so forth, it just really varies.
Small ships don't have spaces for a real library but you'll find more than enough reading material floating around to get your mind off of where you are.
Pocket books have been popular with military personel for years because you can store em easily and most of them can be started and finished in a couple days total time. We had a lot of the old standbys that floated around the ships berthing spaces like books by Zane Grey and Louis LaMoore that were pure fiction and could get your mind off where you were and what you were doing. Everybody bought what they liked and when they were done reading it put it on the main table in the berthing spaces for someone else to pick up.
USS Liberty, Never Forget.
I believe in Murrays Law, he thought Murphy was an optimist.
On Subs, the library is really small, just one locker usually(I was the library PO) You get new paperbacks monthly, but there generally aren't any advancement pubs offered they are usually on the ships LAN... Or you could bring your own if you have the rack space to store them all. I usually didn't...