public final class OpaqueMemoryResource<T> extends Object implements AutoCloseable
The resource must be closed after it is not used any more.
Constructor and Description |
---|
OpaqueMemoryResource(T resourceHandle,
long size,
ThrowingRunnable<Exception> disposer) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Releases this resource.
|
T |
getResourceHandle()
Gets the handle to the resource.
|
long |
getSize()
Gets the size, in bytes.
|
String |
toString() |
public OpaqueMemoryResource(T resourceHandle, long size, ThrowingRunnable<Exception> disposer)
public T getResourceHandle()
public long getSize()
public void close() throws Exception
close
in interface AutoCloseable
Exception
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.