Class SafeHandle
- java.lang.Object
-
- com.microsoft.cognitiveservices.speech.util.SafeHandle
-
- All Implemented Interfaces:
AutoCloseable
public class SafeHandle extends Object implements AutoCloseable
Internal SafeHandle class Note: close() must be called in order to release underlying resources held by the object.
-
-
Constructor Summary
Constructors Constructor Description SafeHandle(long val, SafeHandleType type)A safe handle that implements AutoCloseable
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Dispose of associated resources.protected voidfinalize()longgetValue()Gets the long valuevoidsetValue(long newValue)Sets the long value
-
-
-
Constructor Detail
-
SafeHandle
public SafeHandle(long val, SafeHandleType type)A safe handle that implements AutoCloseable- Parameters:
val- The value.type- the type
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
-
setValue
public void setValue(long newValue)
Sets the long value- Parameters:
newValue- Long value to set.
-
getValue
public long getValue()
Gets the long value- Returns:
- long value
-
close
public void close()
Dispose of associated resources. Note: close() must be called in order to release underlying resources held by the object.- Specified by:
closein interfaceAutoCloseable
-
-