Class Data

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class Data
    extends Managed
    Data holds an immutable data buffer.
    • Constructor Detail

      • Data

        @Internal
        public Data​(long ptr)
    • Method Detail

      • getSize

        public long getSize()
      • getBytes

        public byte[] getBytes()
      • getBytes

        public byte[] getBytes​(long offset,
                               long length)
      • _nativeEquals

        @Internal
        public boolean _nativeEquals​(Native other)
        Returns true if these two objects have the same length and contents, effectively returning 0 == memcmp(...)
        Overrides:
        _nativeEquals in class Native
      • makeFromBytes

        public static Data makeFromBytes​(byte[] bytes)
      • makeFromBytes

        public static Data makeFromBytes​(byte[] bytes,
                                         long offset,
                                         long length)
      • makeFromFileName

        public static Data makeFromFileName​(java.lang.String path)
        Create a new dataref the file with the specified path. If the file cannot be opened, this returns null.
      • makeSubset

        public Data makeSubset​(long offset,
                               long length)
        Create a new dataref using a subset of the data in the specified src dataref.
      • makeCopy

        public Data makeCopy()
      • toByteBuffer

        public java.nio.ByteBuffer toByteBuffer()
      • makeEmpty

        public static Data makeEmpty()
        Returns a new empty dataref (or a reference to a shared empty dataref). New or shared, the caller must see that Managed.close() is eventually called.
      • _nGetFinalizer

        public static long _nGetFinalizer()
      • _nSize

        public static long _nSize​(long ptr)
      • _nBytes

        public static byte[] _nBytes​(long ptr,
                                     long offset,
                                     long length)
      • _nEquals

        public static boolean _nEquals​(long ptr,
                                       long otherPtr)
      • _nToByteBuffer

        public static java.nio.ByteBuffer _nToByteBuffer​(long ptr)
      • _nMakeFromBytes

        public static long _nMakeFromBytes​(byte[] bytes,
                                           long offset,
                                           long length)
      • _nMakeFromFileName

        public static long _nMakeFromFileName​(java.lang.String path)
      • _nMakeSubset

        public static long _nMakeSubset​(long ptr,
                                        long offset,
                                        long length)
      • _nMakeEmpty

        public static long _nMakeEmpty()