I’m working with LogManager.readConfiguration() which requires an InputStream whose contents I’d like to come from a string. Is there an equivalent of StringBufferInputStream that’s not deprecated, such as a ReaderToInputStreamAdaptor?
I’m working with LogManager.readConfiguration() which requires an InputStream whose contents I’d like to come
Share
Documentation of
LogManager.readConfiguration()says that it accepts data injava.util.Propertiesformat. So, the really correct encoding-safe implementation is this:EDIT: Encoding algorithm corrected
EDIT2: Actually,
java.util.Propertiesformat have some other restrictions (such as escaping of\and other special characters), see docsEDIT3: 0x00-0x1f escaping removed, as Alan Moore suggests