I spent 13 days of my 48 years on this planet in a county jail. There is nothing positive about being locked up and treated like livestock.
Not in the immediate sense, but over the course of one's life it can be very uplifting, depending on one's situation. Ask Alexsandr Solzhenitsyn. He ended up thanking God that he had been arrested and thrown into the Gulag, knowing that had it not happened he would have ended up like the people who had put him there.