public class ModuleReaderProxy extends Object implements Closeable
| Modifier and Type | Method and 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 Closeableclose in interface AutoCloseablepublic List<String> list() throws SecurityException
SecurityException - If the module cannot be accessed.public InputStream open(String path) throws SecurityException
path - The path to the resource to open.InputStream for the content of the resource.SecurityException - If the module cannot be accessed.IllegalArgumentException - If the module cannot be accessed.public ByteBuffer read(String path) throws SecurityException, OutOfMemoryError
release(ByteBuffer)
when you have finished with the ByteBuffer.path - The path to the resource to open.ByteBuffer for the content of the resource.SecurityException - If the module cannot be accessed.OutOfMemoryError - if the resource is larger than 2GB, the maximum capacity of a byte buffer.public void release(ByteBuffer byteBuffer)
ByteBuffer allocated by calling read(String).byteBuffer - The ByteBuffer to release.Copyright © 2022. All rights reserved.