Package io.github.humbleui.skija
Class Data
- java.lang.Object
-
- io.github.humbleui.skija.impl.Native
-
- io.github.humbleui.skija.impl.Managed
-
- io.github.humbleui.skija.Data
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class Data extends Managed
Data holds an immutable data buffer.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classData._FinalizerHolder-
Nested classes/interfaces inherited from class io.github.humbleui.skija.impl.Managed
Managed.CleanerThunk
-
-
Field Summary
-
Fields inherited from class io.github.humbleui.skija.impl.Managed
_cleanable
-
-
Constructor Summary
Constructors Constructor Description Data(long ptr)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean_nativeEquals(Native other)Returns true if these two objects have the same length and contents, effectively returning 0 == memcmp(...)static byte[]_nBytes(long ptr, long offset, long length)static boolean_nEquals(long ptr, long otherPtr)static long_nGetFinalizer()static long_nMakeEmpty()static long_nMakeFromBytes(byte[] bytes, long offset, long length)static long_nMakeFromFileName(java.lang.String path)static long_nMakeSubset(long ptr, long offset, long length)static long_nSize(long ptr)static java.nio.ByteBuffer_nToByteBuffer(long ptr)byte[]getBytes()byte[]getBytes(long offset, long length)longgetSize()DatamakeCopy()static DatamakeEmpty()Returns a new empty dataref (or a reference to a shared empty dataref).static DatamakeFromBytes(byte[] bytes)static DatamakeFromBytes(byte[] bytes, long offset, long length)static DatamakeFromFileName(java.lang.String path)Create a new dataref the file with the specified path.DatamakeSubset(long offset, long length)Create a new dataref using a subset of the data in the specified src dataref.java.nio.ByteBuffertoByteBuffer()-
Methods inherited from class io.github.humbleui.skija.impl.Managed
_nInvokeFinalizer, close, isClosed
-
-
-
-
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:
_nativeEqualsin classNative
-
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 thatManaged.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()
-
-