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 * @author Wiktor Niesiobędzki 009 * 010 * Class that will hold JCS cache entries 011 * 012 */ 013public class CacheEntry implements Serializable { 014 private static final long serialVersionUID = 1L; //version 015 protected byte[] content; 016 017 /** 018 * @param content of the cache entry 019 */ 020 public CacheEntry(byte[] content) { 021 this.content = Arrays.copyOf(content, content.length); 022 } 023 024 /** 025 * @return cache entry content 026 */ 027 public byte[] getContent() { 028 if (content == null) { 029 return new byte[]{}; 030 } 031 return Arrays.copyOf(content, content.length); 032 } 033}