question: private static byte [ ] serializePropertiesToByteArray ( Properties p ) throws IOException { ByteArrayOutputStream out = new ByteArrayOutputStream ( 4096 ) ; Properties props = new Properties ( ) ; Set < String > keyset = p . stringPropertyNames ( ) ; for ( String key : keyset ) { String value = p . getProperty ( key ) ; props . put ( key , value ) ; } props . store ( out , null ) ; return out . toByteArray ( ) ; }
target:  Write the given properties list to a byte array and return it. Properties with a key or value that is not a String is filtered out. The stream written to the byte array is ISO 8859-1 encoded.