android $ NativeAssetFileDescriptor :: SELF
Type of this instance, automatically specialized in every classandroid $ NativeAssetFileDescriptor :: new_global_ref
HACK for bug #845android $ NativeAssetFileDescriptor :: to_s
User readable representation ofself
.
core :: Pointer :: address_is_null
Is the address behind this Object at NULL?core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
jvm :: JavaObject :: defaultinit
core :: Pointer :: defaultinit
core :: Object :: defaultinit
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
jvm :: JavaObject :: new_global_ref
Returns a global reference to the Java object behind this referencecore :: Object :: output_class_name
Display class name on stdout (debug only).jvm :: JavaObject :: pop_from_local_frame
Pops the current local reference frame and return a valid reference to selfjvm :: JavaObject :: pop_from_local_frame_with_env
Java implementation ofpop_from_local_frame
jvm :: JavaObject :: to_java_string
JavaString
representation of self
using Java's toString
# Android AssetFileDescriptor, can be retrieve by AssetManager and used to load a sound in a SoundPool
extern class NativeAssetFileDescriptor in "Java" `{ android.content.res.AssetFileDescriptor `}
super JavaObject
fun close in "Java" `{
try {
self.close();
}catch(IOException e){
e.printStackTrace();
}
`}
fun create_input_stream: NativeFileInputStream in "Java" `{
try {
return self.createInputStream();
}catch(IOException e){
Log.e("Error creating input_stream", e.getMessage());
e.printStackTrace();
return null;
}
`}
fun create_output_stream: NativeFileOutputStream in "Java" `{
try {
return self.createOutputStream();
}catch(IOException e){
Log.e("Error creating output stream", e.getMessage());
e.printStackTrace();
return null;
}
`}
fun describe_contents: Int in "Java" `{ return (int)self.describeContents(); `}
fun declared_length: Int in "Java" `{ return (int)self.getDeclaredLength(); `}
# fun extras: Bundle in "Java" `{ return self.getExtras(); `}
fun file_descriptor: NativeFileDescriptor in "Java" `{
FileDescriptor fd = self.getFileDescriptor();
if (fd == null) {
Log.e("AssetFileDesciptorError", "Can't retrieve the FileDescriptor of this AssetFileDescriptor");
}
return fd;
`}
fun length: Int in "Java" `{ return (int)self.getLength(); `}
fun start_offset: Int in "Java" `{ return (int)self.getStartOffset(); `}
redef fun to_s import JavaString.to_s in "Java" `{ return JavaString_to_s(self.toString()); `}
# HACK for bug #845
redef fun new_global_ref import sys, Sys.jni_env `{
Sys sys = NativeAssetFileDescriptor_sys(self);
JNIEnv *env = Sys_jni_env(sys);
return (*env)->NewGlobalRef(env, self);
`}
end
lib/android/assets_and_resources.nit:346,1--397,3