Class VBlob
java.lang.Object
app.photofox.vipsffm.VBlob
Represents a VipsBlob, which is backed by a contiguous area of off-heap memory
Its constructor is package private to prevent leaking MemorySegments in to the vips-ffm API
Use its static helper methods to create new blobs
-
Method Summary
Modifier and TypeMethodDescriptionByteBuffer representation of the data in this blob Mapped to native memory viaDirectByteBuffer
, hence does not make a copy, so the data has the same data lifetime asarena
Deprecated, for removal: This API element is subject to removal in a future version.ByteBuffer representation of the data in this blob A full copy of the data is taken, so that its contents are not coupled to the scope ofarena
long
byteSize()
Size of the data in this blobDeprecated, for removal: This API element is subject to removal in a future version.Replaced bygetUnsafeStructAddress()
Not recommended for use, useasByteBuffer()
instead Gets the rawMemorySegment
(C pointer) for the data in this blob Sliced to the length of the data, which isn't always null terminatedGets the rawMemorySegment
(C pointer) for this VipsBlob struct You might want the data address insteadgetUnsafeDataAddress()
The memory address' lifetime is bound to the scope of thearena
Usage of the memory address is strongly discouraged, but it is available if some functionality is missing and you need to use it withVipsHelper
static VBlob
newFromBytes
(Arena arena, byte[] bytes) Creates a new VBlob from a fixed array of bytes This must copy the data - it's generally more efficient to useVImage.newFromFile(Arena, String, VipsOption...)
,VImage.newFromSource(Arena, VSource, String, VipsOption...)
, and friends
-
Method Details
-
newFromBytes
Creates a new VBlob from a fixed array of bytes This must copy the data - it's generally more efficient to useVImage.newFromFile(Arena, String, VipsOption...)
,VImage.newFromSource(Arena, VSource, String, VipsOption...)
, and friends- Parameters:
arena
- An arena constraining the lifetime of this blobbytes
- The bytes to wrap- Throws:
VipsError
-
getUnsafeAddress
@Deprecated(since="0.5.10", forRemoval=true) public MemorySegment getUnsafeAddress() throws VipsErrorDeprecated, for removal: This API element is subject to removal in a future version.Replaced bygetUnsafeStructAddress()
- Throws:
VipsError
-
getUnsafeStructAddress
Gets the rawMemorySegment
(C pointer) for this VipsBlob struct You might want the data address insteadgetUnsafeDataAddress()
The memory address' lifetime is bound to the scope of thearena
Usage of the memory address is strongly discouraged, but it is available if some functionality is missing and you need to use it withVipsHelper
- Throws:
VipsError
-
getUnsafeDataAddress
Not recommended for use, useasByteBuffer()
instead Gets the rawMemorySegment
(C pointer) for the data in this blob Sliced to the length of the data, which isn't always null terminated- Throws:
VipsError
-
byteSize
public long byteSize()Size of the data in this blob -
asByteBuffer
Deprecated, for removal: This API element is subject to removal in a future version.Replaced byasArenaScopedByteBuffer()
-
asArenaScopedByteBuffer
ByteBuffer representation of the data in this blob Mapped to native memory viaDirectByteBuffer
, hence does not make a copy, so the data has the same data lifetime asarena
-
asClonedByteBuffer
ByteBuffer representation of the data in this blob A full copy of the data is taken, so that its contents are not coupled to the scope ofarena
-
asArenaScopedByteBuffer()