Uses of Interface
java.lang.foreign.MemorySegment
Packages that use MemorySegmentPREVIEW
Package
Description
Provides low-level access to memory and functions outside the Java runtime.
Defines channels, which represent connections to entities that are capable of
performing I/O operations, such as files and sockets; defines selectors, for
multiplexed, non-blocking I/O operations.
Incubating Feature. Will be removed in a future release.
-
Uses of MemorySegmentPREVIEW in java.lang.foreign
Methods in java.lang.foreign that return MemorySegmentPREVIEWModifier and TypeMethodDescriptiondefault MemorySegmentPREVIEWMemorySession.allocate(long bytesSize, long bytesAlignment) Allocates a native segment, using this session.default MemorySegmentPREVIEWSegmentAllocator.allocate(long bytesSize) Allocates a memory segment with the given size.SegmentAllocator.allocate(long bytesSize, long bytesAlignment) Allocates a memory segment with the given size and alignment constraints.default MemorySegmentPREVIEWSegmentAllocator.allocate(MemoryLayoutPREVIEW layout) Allocates a memory segment with the given layout.default MemorySegmentPREVIEWSegmentAllocator.allocate(ValueLayout.OfAddressPREVIEW layout, AddressablePREVIEW value) Allocates a memory segment with the given layout and initializes it with the given address value.default MemorySegmentPREVIEWSegmentAllocator.allocate(ValueLayout.OfBytePREVIEW layout, byte value) Allocates a memory segment with the given layout and initializes it with the given byte value.default MemorySegmentPREVIEWSegmentAllocator.allocate(ValueLayout.OfCharPREVIEW layout, char value) Allocates a memory segment with the given layout and initializes it with the given char value.default MemorySegmentPREVIEWSegmentAllocator.allocate(ValueLayout.OfDoublePREVIEW layout, double value) Allocates a memory segment with the given layout and initializes it with the given double value.default MemorySegmentPREVIEWSegmentAllocator.allocate(ValueLayout.OfFloatPREVIEW layout, float value) Allocates a memory segment with the given layout and initializes it with the given float value.default MemorySegmentPREVIEWSegmentAllocator.allocate(ValueLayout.OfIntPREVIEW layout, int value) Allocates a memory segment with the given layout and initializes it with the given int value.default MemorySegmentPREVIEWSegmentAllocator.allocate(ValueLayout.OfLongPREVIEW layout, long value) Allocates a memory segment with the given layout and initializes it with the given long value.default MemorySegmentPREVIEWSegmentAllocator.allocate(ValueLayout.OfShortPREVIEW layout, short value) Allocates a memory segment with the given layout and initializes it with the given short value.default MemorySegmentPREVIEWSegmentAllocator.allocateArray(MemoryLayoutPREVIEW elementLayout, long count) Allocates a memory segment with the given element layout and size.default MemorySegmentPREVIEWSegmentAllocator.allocateArray(ValueLayout.OfBytePREVIEW elementLayout, byte... elements) Allocates a memory segment with the given layout and initializes it with the given byte elements.default MemorySegmentPREVIEWSegmentAllocator.allocateArray(ValueLayout.OfCharPREVIEW elementLayout, char... elements) Allocates a memory segment with the given layout and initializes it with the given char elements.default MemorySegmentPREVIEWSegmentAllocator.allocateArray(ValueLayout.OfDoublePREVIEW elementLayout, double... elements) Allocates a memory segment with the given layout and initializes it with the given double elements.default MemorySegmentPREVIEWSegmentAllocator.allocateArray(ValueLayout.OfFloatPREVIEW elementLayout, float... elements) Allocates a memory segment with the given layout and initializes it with the given float elements.default MemorySegmentPREVIEWSegmentAllocator.allocateArray(ValueLayout.OfIntPREVIEW elementLayout, int... elements) Allocates a memory segment with the given layout and initializes it with the given int elements.default MemorySegmentPREVIEWSegmentAllocator.allocateArray(ValueLayout.OfLongPREVIEW elementLayout, long... elements) Allocates a memory segment with the given layout and initializes it with the given long elements.default MemorySegmentPREVIEWSegmentAllocator.allocateArray(ValueLayout.OfShortPREVIEW elementLayout, short... elements) Allocates a memory segment with the given layout and initializes it with the given short elements.static MemorySegmentPREVIEWMemorySegment.allocateNative(long bytesSize, long alignmentBytes, MemorySessionPREVIEW session) Creates a native memory segment with the given size (in bytes), alignment constraint (in bytes) and memory session.static MemorySegmentPREVIEWMemorySegment.allocateNative(long bytesSize, MemorySessionPREVIEW session) Creates a native memory segment with the given size (in bytes) and memory session.static MemorySegmentPREVIEWMemorySegment.allocateNative(MemoryLayoutPREVIEW layout, MemorySessionPREVIEW session) Creates a native memory segment with the given layout and memory session.default MemorySegmentPREVIEWSegmentAllocator.allocateUtf8String(String str) Converts a Java string into a UTF-8 encoded, null-terminated C string, storing the result into a memory segment.MemorySegment.asReadOnly()Returns a read-only view of this segment.default MemorySegmentPREVIEWMemorySegment.asSlice(long offset) Returns a slice of this memory segment, at the given offset.MemorySegment.asSlice(long offset, long newSize) Returns a slice of this memory segment, at the given offset.default MemorySegmentPREVIEWMemorySegment.copyFrom(MemorySegmentPREVIEW src) Performs a bulk copy from given source segment to this segment.MemorySegment.fill(byte value) Fills a value into this memory segment.VaList.nextVarg(GroupLayoutPREVIEW layout, SegmentAllocatorPREVIEW allocator) Reads the next value as aMemorySegment, and advances this variable argument list's position.static MemorySegmentPREVIEWMemorySegment.ofAddress(MemoryAddressPREVIEW address, long bytesSize, MemorySessionPREVIEW session) Creates a native memory segment with the given size, base address, and memory session.static MemorySegmentPREVIEWMemorySegment.ofArray(byte[] arr) Creates an array memory segment that models the memory associated with the given heap-allocated byte array.static MemorySegmentPREVIEWMemorySegment.ofArray(char[] arr) Creates an array memory segment that models the memory associated with the given heap-allocated char array.static MemorySegmentPREVIEWMemorySegment.ofArray(double[] arr) Creates an array memory segment that models the memory associated with the given heap-allocated double array.static MemorySegmentPREVIEWMemorySegment.ofArray(float[] arr) Creates an array memory segment that models the memory associated with the given heap-allocated float array.static MemorySegmentPREVIEWMemorySegment.ofArray(int[] arr) Creates an array memory segment that models the memory associated with the given heap-allocated int array.static MemorySegmentPREVIEWMemorySegment.ofArray(long[] arr) Creates an array memory segment that models the memory associated with the given heap-allocated long array.static MemorySegmentPREVIEWMemorySegment.ofArray(short[] arr) Creates an array memory segment that models the memory associated with the given heap-allocated short array.static MemorySegmentPREVIEWCreates a buffer memory segment that models the memory associated with the givenBufferinstance.Linker.upcallStub(MethodHandle target, FunctionDescriptorPREVIEW function, MemorySessionPREVIEW session) Creates a stub which can be passed to other foreign functions as a function pointer, with the given memory session.Methods in java.lang.foreign that return types with arguments of type MemorySegmentPREVIEWModifier and TypeMethodDescriptionMemorySegment.asOverlappingSlice(MemorySegmentPREVIEW other) Returns a slice of this segment that is the overlap between this and the provided segment.MemorySegment.elements(MemoryLayoutPREVIEW elementLayout) Returns a sequentialStreamover disjoint slices (whose size matches that of the specified layout) in this segment.Returns the address of the symbol with the given name.MemorySegment.spliterator(MemoryLayoutPREVIEW elementLayout) Returns a spliterator for this memory segment.Methods in java.lang.foreign with parameters of type MemorySegmentPREVIEWModifier and TypeMethodDescriptionVaList.Builder.addVarg(GroupLayoutPREVIEW layout, MemorySegmentPREVIEW value) Writes aMemorySegmentvalue, with the given layout, to the variable argument list being constructed.MemorySegment.asOverlappingSlice(MemorySegmentPREVIEW other) Returns a slice of this segment that is the overlap between this and the provided segment.static voidMemorySegment.copy(MemorySegmentPREVIEW srcSegment, long srcOffset, MemorySegmentPREVIEW dstSegment, long dstOffset, long bytes) Performs a bulk copy from source segment to destination segment.static voidMemorySegment.copy(MemorySegmentPREVIEW srcSegment, ValueLayoutPREVIEW srcElementLayout, long srcOffset, MemorySegmentPREVIEW dstSegment, ValueLayoutPREVIEW dstElementLayout, long dstOffset, long elementCount) Performs a bulk copy from source segment to destination segment.static voidMemorySegment.copy(MemorySegmentPREVIEW srcSegment, ValueLayoutPREVIEW srcLayout, long srcOffset, Object dstArray, int dstIndex, int elementCount) Copies a number of elements from a source memory segment to a destination array.static voidMemorySegment.copy(Object srcArray, int srcIndex, MemorySegmentPREVIEW dstSegment, ValueLayoutPREVIEW dstLayout, long dstOffset, int elementCount) Copies a number of elements from a source array to a destination memory segment.default MemorySegmentPREVIEWMemorySegment.copyFrom(MemorySegmentPREVIEW src) Performs a bulk copy from given source segment to this segment.longMemorySegment.mismatch(MemorySegmentPREVIEW other) Finds and returns the offset, in bytes, of the first mismatch between this segment and the given other segment.static SegmentAllocatorPREVIEWSegmentAllocator.prefixAllocator(MemorySegmentPREVIEW segment) Returns a segment allocator which responds to allocation requests by recycling a single segment.longMemorySegment.segmentOffset(MemorySegmentPREVIEW other) Returns the offset, in bytes, of the provided segment, relative to this segment. -
Uses of MemorySegmentPREVIEW in java.nio.channels
Methods in java.nio.channels that return MemorySegmentPREVIEWModifier and TypeMethodDescriptionFileChannel.map(FileChannel.MapMode mode, long offset, long size, MemorySessionPREVIEW session) Preview.Maps a region of this channel's file into a new mapped memory segment, with the given offset, size and memory session. -
Uses of MemorySegmentPREVIEW in jdk.incubator.vector
Methods in jdk.incubator.vector with parameters of type MemorySegmentPREVIEWModifier and TypeMethodDescriptionstatic ByteVectorByteVector.fromMemorySegment(VectorSpecies<Byte> species, MemorySegmentPREVIEW ms, long offset, ByteOrder bo) Loads a vector from a memory segmentPREVIEW starting at an offset into the memory segment.static ByteVectorByteVector.fromMemorySegment(VectorSpecies<Byte> species, MemorySegmentPREVIEW ms, long offset, ByteOrder bo, VectorMask<Byte> m) Loads a vector from a memory segmentPREVIEW starting at an offset into the memory segment and using a mask.static DoubleVectorDoubleVector.fromMemorySegment(VectorSpecies<Double> species, MemorySegmentPREVIEW ms, long offset, ByteOrder bo) Loads a vector from a memory segmentPREVIEW starting at an offset into the memory segment.static DoubleVectorDoubleVector.fromMemorySegment(VectorSpecies<Double> species, MemorySegmentPREVIEW ms, long offset, ByteOrder bo, VectorMask<Double> m) Loads a vector from a memory segmentPREVIEW starting at an offset into the memory segment and using a mask.static FloatVectorFloatVector.fromMemorySegment(VectorSpecies<Float> species, MemorySegmentPREVIEW ms, long offset, ByteOrder bo) Loads a vector from a memory segmentPREVIEW starting at an offset into the memory segment.static FloatVectorFloatVector.fromMemorySegment(VectorSpecies<Float> species, MemorySegmentPREVIEW ms, long offset, ByteOrder bo, VectorMask<Float> m) Loads a vector from a memory segmentPREVIEW starting at an offset into the memory segment and using a mask.static IntVectorIntVector.fromMemorySegment(VectorSpecies<Integer> species, MemorySegmentPREVIEW ms, long offset, ByteOrder bo) Loads a vector from a memory segmentPREVIEW starting at an offset into the memory segment.static IntVectorIntVector.fromMemorySegment(VectorSpecies<Integer> species, MemorySegmentPREVIEW ms, long offset, ByteOrder bo, VectorMask<Integer> m) Loads a vector from a memory segmentPREVIEW starting at an offset into the memory segment and using a mask.static LongVectorLongVector.fromMemorySegment(VectorSpecies<Long> species, MemorySegmentPREVIEW ms, long offset, ByteOrder bo) Loads a vector from a memory segmentPREVIEW starting at an offset into the memory segment.static LongVectorLongVector.fromMemorySegment(VectorSpecies<Long> species, MemorySegmentPREVIEW ms, long offset, ByteOrder bo, VectorMask<Long> m) Loads a vector from a memory segmentPREVIEW starting at an offset into the memory segment and using a mask.static ShortVectorShortVector.fromMemorySegment(VectorSpecies<Short> species, MemorySegmentPREVIEW ms, long offset, ByteOrder bo) Loads a vector from a memory segmentPREVIEW starting at an offset into the memory segment.static ShortVectorShortVector.fromMemorySegment(VectorSpecies<Short> species, MemorySegmentPREVIEW ms, long offset, ByteOrder bo, VectorMask<Short> m) Loads a vector from a memory segmentPREVIEW starting at an offset into the memory segment and using a mask.VectorSpecies.fromMemorySegment(MemorySegmentPREVIEW ms, long offset, ByteOrder bo) Loads a vector of this species from a memory segmentPREVIEW starting at an offset into the memory segment.final voidByteVector.intoMemorySegment(MemorySegmentPREVIEW ms, long offset, ByteOrder bo) Stores this vector into a memory segmentPREVIEW starting at an offset using explicit byte order.final voidByteVector.intoMemorySegment(MemorySegmentPREVIEW ms, long offset, ByteOrder bo, VectorMask<Byte> m) Stores this vector into a memory segmentPREVIEW starting at an offset using explicit byte order and a mask.final voidDoubleVector.intoMemorySegment(MemorySegmentPREVIEW ms, long offset, ByteOrder bo) Stores this vector into a memory segmentPREVIEW starting at an offset using explicit byte order.final voidDoubleVector.intoMemorySegment(MemorySegmentPREVIEW ms, long offset, ByteOrder bo, VectorMask<Double> m) Stores this vector into a memory segmentPREVIEW starting at an offset using explicit byte order and a mask.final voidFloatVector.intoMemorySegment(MemorySegmentPREVIEW ms, long offset, ByteOrder bo) Stores this vector into a memory segmentPREVIEW starting at an offset using explicit byte order.final voidFloatVector.intoMemorySegment(MemorySegmentPREVIEW ms, long offset, ByteOrder bo, VectorMask<Float> m) Stores this vector into a memory segmentPREVIEW starting at an offset using explicit byte order and a mask.final voidIntVector.intoMemorySegment(MemorySegmentPREVIEW ms, long offset, ByteOrder bo) Stores this vector into a memory segmentPREVIEW starting at an offset using explicit byte order.final voidIntVector.intoMemorySegment(MemorySegmentPREVIEW ms, long offset, ByteOrder bo, VectorMask<Integer> m) Stores this vector into a memory segmentPREVIEW starting at an offset using explicit byte order and a mask.final voidLongVector.intoMemorySegment(MemorySegmentPREVIEW ms, long offset, ByteOrder bo) Stores this vector into a memory segmentPREVIEW starting at an offset using explicit byte order.final voidLongVector.intoMemorySegment(MemorySegmentPREVIEW ms, long offset, ByteOrder bo, VectorMask<Long> m) Stores this vector into a memory segmentPREVIEW starting at an offset using explicit byte order and a mask.final voidShortVector.intoMemorySegment(MemorySegmentPREVIEW ms, long offset, ByteOrder bo) Stores this vector into a memory segmentPREVIEW starting at an offset using explicit byte order.final voidShortVector.intoMemorySegment(MemorySegmentPREVIEW ms, long offset, ByteOrder bo, VectorMask<Short> m) Stores this vector into a memory segmentPREVIEW starting at an offset using explicit byte order and a mask.abstract voidVector.intoMemorySegment(MemorySegmentPREVIEW ms, long offset, ByteOrder bo) Stores this vector into a memory segmentPREVIEW starting at an offset using explicit byte order.abstract voidVector.intoMemorySegment(MemorySegmentPREVIEW ms, long offset, ByteOrder bo, VectorMask<E> m) Stores this vector into a memory segmentPREVIEW starting at an offset using explicit byte order and a mask.