Code example for Inflater

Methods: end, inflate, setInput

0
public class Geoget { 
 
    private static final String TAG = "LocusAddonGeogetDatabase|GeogetUtils";
 
    public static String decodeZlib(byte[] s, byte[] buff) throws DataFormatException, UnsupportedEncodingException {
        Inflater decompresser = new Inflater();
        decompresser.setInput(s, 0, s.length);
        int resultLength = decompresser.inflate(buff);
        decompresser.end();
        return new String(buff, 0, resultLength, "UTF-8");
    } 
 
    public static int convertLogType(String logType) {
        if (logType.equals("Announcement")) {
            return PointGeocachingData.CACHE_LOG_TYPE_ANNOUNCEMENT; 
        } else if (logType.equals("Attended")) {
            return PointGeocachingData.CACHE_LOG_TYPE_ATTENDED; 
        } else if (logType.equals("Didn't find it")) {
            return PointGeocachingData.CACHE_LOG_TYPE_NOT_FOUNDED; 
        } else if (logType.equals("Enable Listing")) {
            return PointGeocachingData.CACHE_LOG_TYPE_ENABLE_LISTING;