1071 * If {@code arena} is a confined scoped arena, and this method is called from a
1072 * thread {@code T}, other than the scoped arena's owner thread.
1073 *
1074 * @throws NonReadableChannelException
1075 * If the {@code mode} is {@link MapMode#READ_ONLY READ_ONLY} or
1076 * an implementation specific map mode requiring read access,
1077 * but this channel was not opened for reading.
1078 *
1079 * @throws NonWritableChannelException
1080 * If the {@code mode} is {@link MapMode#READ_WRITE READ_WRITE},
1081 * {@link MapMode#PRIVATE PRIVATE} or an implementation specific
1082 * map mode requiring write access, but this channel was not
1083 * opened for both reading and writing.
1084 *
1085 * @throws IOException
1086 * If some other I/O error occurs.
1087 *
1088 * @throws UnsupportedOperationException
1089 * If an unsupported map mode is specified.
1090 *
1091 * @since 19
1092 */
1093 @PreviewFeature(feature=PreviewFeature.Feature.FOREIGN)
1094 public MemorySegment map(MapMode mode, long offset, long size, Arena arena)
1095 throws IOException
1096 {
1097 throw new UnsupportedOperationException();
1098 }
1099
1100 // -- Locks --
1101
1102 /**
1103 * Acquires a lock on the given region of this channel's file.
1104 *
1105 * <p> An invocation of this method will block until the region can be
1106 * locked, this channel is closed, or the invoking thread is interrupted,
1107 * whichever comes first.
1108 *
1109 * <p> If this channel is closed by another thread during an invocation of
1110 * this method then an {@link AsynchronousCloseException} will be thrown.
1111 *
1112 * <p> If the invoking thread is interrupted while waiting to acquire the
1113 * lock then its interrupt status will be set and a {@link
|
1071 * If {@code arena} is a confined scoped arena, and this method is called from a
1072 * thread {@code T}, other than the scoped arena's owner thread.
1073 *
1074 * @throws NonReadableChannelException
1075 * If the {@code mode} is {@link MapMode#READ_ONLY READ_ONLY} or
1076 * an implementation specific map mode requiring read access,
1077 * but this channel was not opened for reading.
1078 *
1079 * @throws NonWritableChannelException
1080 * If the {@code mode} is {@link MapMode#READ_WRITE READ_WRITE},
1081 * {@link MapMode#PRIVATE PRIVATE} or an implementation specific
1082 * map mode requiring write access, but this channel was not
1083 * opened for both reading and writing.
1084 *
1085 * @throws IOException
1086 * If some other I/O error occurs.
1087 *
1088 * @throws UnsupportedOperationException
1089 * If an unsupported map mode is specified.
1090 *
1091 * @since 22
1092 */
1093 public MemorySegment map(MapMode mode, long offset, long size, Arena arena)
1094 throws IOException
1095 {
1096 throw new UnsupportedOperationException();
1097 }
1098
1099 // -- Locks --
1100
1101 /**
1102 * Acquires a lock on the given region of this channel's file.
1103 *
1104 * <p> An invocation of this method will block until the region can be
1105 * locked, this channel is closed, or the invoking thread is interrupted,
1106 * whichever comes first.
1107 *
1108 * <p> If this channel is closed by another thread during an invocation of
1109 * this method then an {@link AsynchronousCloseException} will be thrown.
1110 *
1111 * <p> If the invoking thread is interrupted while waiting to acquire the
1112 * lock then its interrupt status will be set and a {@link
|