public class MetaclassBase extends Object
Modifier and Type | Class and Description |
---|---|
protected static class |
MetaclassBase.TemporaryFileSet
A subclass of
LinkedHashSet that holds temporary files and doubles as a deletion hook. |
Modifier and Type | Field and Description |
---|---|
protected static int |
BULK_TRANSFER_SIZE
The bulk transfer size for
InputStream s and OutputStream s. |
protected static Map<ResourceRegistry,MetaclassBase.TemporaryFileSet> |
rrToTfsMap
A weak mapping from
ResourceRegistry s to MetaclassBase.TemporaryFileSet s. |
protected static Set<MetaclassBase.TemporaryFileSet> |
tfss
A weak set of
MetaclassBase.TemporaryFileSet s. |
Modifier and Type | Method and Description |
---|---|
static void |
close(Closeable closeable)
A
Closeable.close() convenience wrapper. |
static byte[] |
getBytes(InputStream in)
Gets a
byte array from the given stream. |
static URL |
getResourceAsTemporaryFile(ResourceRegistry registry,
String pathname)
Gets a resource from the given registry as a temporary file.
|
static void |
transfer(InputStream in,
OutputStream out)
Transfers the contents of one stream into another.
|
protected static final int BULK_TRANSFER_SIZE
InputStream
s and OutputStream
s.protected static final Map<ResourceRegistry,MetaclassBase.TemporaryFileSet> rrToTfsMap
ResourceRegistry
s to MetaclassBase.TemporaryFileSet
s.protected static final Set<MetaclassBase.TemporaryFileSet> tfss
MetaclassBase.TemporaryFileSet
s.public static final void close(Closeable closeable)
Closeable.close()
convenience wrapper.public static final void transfer(InputStream in, OutputStream out) throws IOException
in
- the InputStream
.out
- the OutputStream
.IOException
- when something goes awry.public static final byte[] getBytes(InputStream in) throws IOException
byte
array from the given stream.in
- the InputStream
.byte
array.IOException
- when something goes awry.public static final URL getResourceAsTemporaryFile(ResourceRegistry registry, String pathname)