Source code: com/imagero/res/Resource.java
1 /*
2 * Copyright (c) imagero Andrey Kuznetsov. All Rights Reserved.
3 * http://jgui.imagero.com
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
8 * any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19
20 package com.imagero.res;
21
22 /**
23 * Resource.<br>
24 * Anything can be embedded direct in Java class and read with proper ResourceReader.
25 * For example complete JPEG or GIF file can be embedded as into Resource.
26 * Pro - no more troubles with ClassLoader#getResource ClassLoader#getResourceAsStream.
27 *
28 * @see ResourceReader
29 * @see ResourceReaderFactory
30 *
31 * @author Andrei Kouznetsov
32 * <br>
33 * Date: 15.07.2004
34 * Time: 13:48:44
35 */
36 public interface Resource {
37 /**
38 * get raw data as byte array
39 * @return byte array
40 */
41 byte [] getData();
42
43 /**
44 * get resource type
45 */
46 String getType();
47 }