AutoCloseable
public class ModuleReaderProxy extends Object implements AutoCloseable
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
Calls ModuleReader#close().
|
List<String> |
list() |
Get the list of resources accessible to a ModuleReader.
|
InputStream |
open(String path) |
Use the proxied ModuleReader to open the named resource as an InputStream.
|
ByteBuffer |
read(String path) |
Use the proxied ModuleReader to open the named resource as a ByteBuffer.
|
void |
release(ByteBuffer byteBuffer) |
Release a
ByteBuffer allocated by calling read(String) . |
public void close()
close
in interface AutoCloseable
public List<String> list() throws IOException, SecurityException
IOException
- If the module cannot be read.SecurityException
- If the module cannot be accessed.public InputStream open(String path) throws IOException, SecurityException
path
- The path to the resource to open.InputStream
for the content of the resource.IOException
- If the resource cannot be read.SecurityException
- If the module cannot be accessed.public ByteBuffer read(String path) throws IOException, SecurityException, OutOfMemoryError
path
- The path to the resource to open.ByteBuffer
for the content of the resource.IOException
- If the resource cannot be read.SecurityException
- If the module cannot be accessed.OutOfMemoryError
- if the resource is larger than Integer.MAX_VALUE, the maximum capacity of a byte buffer.public void release(ByteBuffer byteBuffer)
ByteBuffer
allocated by calling read(String)
.byteBuffer
- The ByteBuffer
to release.Copyright © 2018. All rights reserved.