001// License: GPL. For details, see LICENSE file. 002package org.openstreetmap.josm.data.cache; 003 004import java.io.Serializable; 005import java.util.Arrays; 006 007/** 008 * Class that will hold JCS cache entries 009 * 010 * @author Wiktor Niesiobędzki 011 */ 012public class CacheEntry implements Serializable { 013 private static final long serialVersionUID = 1L; //version 014 protected byte[] content; 015 016 /** 017 * @param content of the cache entry 018 */ 019 public CacheEntry(byte[] content) { 020 this.content = Arrays.copyOf(content, content.length); 021 } 022 023 /** 024 * @return cache entry content 025 */ 026 public byte[] getContent() { 027 if (content == null) { 028 return new byte[]{}; 029 } 030 return Arrays.copyOf(content, content.length); 031 } 032}