Class IStreamReader


  • public class IStreamReader
    extends java.lang.Object
    Read data stream interface
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected long nativeObj  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected IStreamReader()
      Constructor of streaming callback object with abstract 'read' and 'seek' methods that should be implemented in Java code.
      NOTE: Implemented callbacks should be called from the creation thread to avoid JNI performance degradation
      protected IStreamReader​(long addr)  
    • Field Detail

      • nativeObj

        protected final long nativeObj
    • Constructor Detail

      • IStreamReader

        protected IStreamReader​(long addr)
      • IStreamReader

        protected IStreamReader()
        Constructor of streaming callback object with abstract 'read' and 'seek' methods that should be implemented in Java code.
        NOTE: Implemented callbacks should be called from the creation thread to avoid JNI performance degradation
    • Method Detail

      • getNativeObjAddr

        public long getNativeObjAddr()
      • __fromPtr__

        public static IStreamReader __fromPtr__​(long addr)
      • read

        public long read​(byte[] buffer,
                         long size)
        Read bytes from stream
        Parameters:
        buffer - already allocated buffer of at least size bytes
        size - maximum number of bytes to read
        Returns:
        actual number of read bytes
      • seek

        public long seek​(long offset,
                         int origin)
        Sets the stream position
        Parameters:
        offset - Seek offset
        origin - SEEK_SET / SEEK_END / SEEK_CUR SEE: fseek
        Returns:
        automatically generated
      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable