source: josm/trunk/src/org/openstreetmap/josm/data/cache/CacheEntry.java@ 9600

Last change on this file since 9600 was 8629, checked in by wiktorn, 9 years ago

Fix NPE in CacheEntry and TMS settings

  • fix NPE in CacheEntry (Closes: #11728)
  • properly handle maximum concurrent downloads for TMS in settings
  • Property svn:eol-style set to native
File size: 767 bytes
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data.cache;
3
4import java.io.Serializable;
5import java.util.Arrays;
6
7/**
8 * @author Wiktor Niesiobędzki
9 *
10 * Class that will hold JCS cache entries
11 *
12 */
13public class CacheEntry implements Serializable {
14 private static final long serialVersionUID = 1L; //version
15 protected byte[] content;
16
17 /**
18 * @param content of the cache entry
19 */
20 public CacheEntry(byte[] content) {
21 this.content = Arrays.copyOf(content, content.length);
22 }
23
24 /**
25 * @return cache entry content
26 */
27 public byte[] getContent() {
28 if (content == null) {
29 return new byte[]{};
30 }
31 return Arrays.copyOf(content, content.length);
32 }
33}
Note: See TracBrowser for help on using the repository browser.