public abstract class ResourceBase extends Object implements Resource
Constructor and Description |
---|
ResourceBase(ResourceKey key) |
Modifier and Type | Method and Description |
---|---|
ResourceKey |
getKey() |
protected RuntimeException |
handleError(IOException e) |
Reader |
openReader() |
InputStream |
openStream() |
byte[] |
readBytes() |
List<String> |
readLines() |
String |
readString() |
void |
requireExists() |
public ResourceBase(ResourceKey key)
public final ResourceKey getKey()
public final InputStream openStream()
openStream
in interface Resource
public final Reader openReader()
openReader
in interface Resource
public final void requireExists()
requireExists
in interface Resource
public final String readString()
readString
in interface Resource
protected final RuntimeException handleError(IOException e)