private static void addCacheFormatEntry ( List < Message > trackListEntries , int playlistId , ZipOutputStream zos ) throws IOException { // Add a marker so we can recognize this as a metadata archive. I would use the ZipFile comment, but // that is not available until Java 7, and Beat Link is supposed to be backwards compatible with Java 6. // Since we are doing this anyway, we can also provide information about the nature of the cache, and // how many metadata entries it contains, which is useful for auto-attachment. zos . putNextEntry ( new ZipEntry ( CACHE_FORMAT_ENTRY ) ) ; String formatEntry = CACHE_FORMAT_IDENTIFIER + ":" + playlistId + ":" + trackListEntries . size ( ) ; zos . write ( formatEntry . getBytes ( "UTF-8" ) ) ; }
Add a marker so we can recognize this as a metadata archive . I would use the ZipFile comment but that is not available until Java 7 and Beat Link is supposed to be backwards compatible with Java 6 . Since we are doing this anyway we can also provide information about the nature of the cache and how many metadata entries it contains which is useful for auto - attachment .