< prev index next >

jdk/src/java.base/share/classes/java/nio/X-Buffer.java.template

Print this page




1047      *          of the first element of the buffer
1048      *
1049      * @throws  ReadOnlyBufferException
1050      *          If this buffer is backed by an array but is read-only
1051      *
1052      * @throws  UnsupportedOperationException
1053      *          If this buffer is not backed by an accessible array
1054      */
1055     public final int arrayOffset() {
1056         if (hb == null)
1057             throw new UnsupportedOperationException();
1058         if (isReadOnly)
1059             throw new ReadOnlyBufferException();
1060         return offset;
1061     }
1062 
1063     // -- Covariant return type overrides
1064 
1065     /**
1066      * {@inheritDoc}
1067      * @since 1.9
1068      */
1069     @Override
1070     public
1071 #if[!byte]
1072     final
1073 #end[!byte]
1074     $Type$Buffer position(int newPosition) {
1075         super.position(newPosition);
1076         return this;
1077     }
1078     
1079     /**
1080      * {@inheritDoc}
1081      * @since 1.9
1082      */
1083     @Override
1084     public
1085 #if[!byte]
1086     final
1087 #end[!byte]
1088     $Type$Buffer limit(int newLimit) {
1089         super.limit(newLimit);
1090         return this;
1091     }
1092     
1093     /**
1094      * {@inheritDoc}
1095      * @since 1.9
1096      */
1097     @Override
1098     public 
1099 #if[!byte]
1100     final
1101 #end[!byte]
1102     $Type$Buffer mark() {
1103         super.mark();
1104         return this;
1105     }
1106 
1107     /**
1108      * {@inheritDoc}
1109      * @since 1.9
1110      */
1111     @Override
1112     public 
1113 #if[!byte]
1114     final
1115 #end[!byte]
1116     $Type$Buffer reset() {
1117         super.reset();
1118         return this;
1119     }
1120 
1121     /**
1122      * {@inheritDoc}
1123      * @since 1.9
1124      */
1125     @Override
1126     public 
1127 #if[!byte]
1128     final
1129 #end[!byte]
1130     $Type$Buffer clear() {
1131         super.clear();
1132         return this;
1133     }
1134 
1135     /**
1136      * {@inheritDoc}
1137      * @since 1.9
1138      */
1139     @Override
1140     public 
1141 #if[!byte]
1142     final
1143 #end[!byte]
1144     $Type$Buffer flip() {
1145         super.flip();
1146         return this;
1147     }
1148 
1149     /**
1150      * {@inheritDoc}
1151      * @since 1.9
1152      */
1153     @Override
1154     public 
1155 #if[!byte]
1156     final
1157 #end[!byte]
1158     $Type$Buffer rewind() {
1159         super.rewind();
1160         return this;
1161     }
1162 
1163     /**
1164      * Compacts this buffer&nbsp;&nbsp;<i>(optional operation)</i>.
1165      *
1166      * <p> The $type$s between the buffer's current position and its limit,
1167      * if any, are copied to the beginning of the buffer.  That is, the
1168      * $type$ at index <i>p</i>&nbsp;=&nbsp;{@code position()} is copied
1169      * to index zero, the $type$ at index <i>p</i>&nbsp;+&nbsp;1 is copied
1170      * to index one, and so forth until the $type$ at index
1171      * {@code limit()}&nbsp;-&nbsp;1 is copied to index




1047      *          of the first element of the buffer
1048      *
1049      * @throws  ReadOnlyBufferException
1050      *          If this buffer is backed by an array but is read-only
1051      *
1052      * @throws  UnsupportedOperationException
1053      *          If this buffer is not backed by an accessible array
1054      */
1055     public final int arrayOffset() {
1056         if (hb == null)
1057             throw new UnsupportedOperationException();
1058         if (isReadOnly)
1059             throw new ReadOnlyBufferException();
1060         return offset;
1061     }
1062 
1063     // -- Covariant return type overrides
1064 
1065     /**
1066      * {@inheritDoc}
1067      * @since 9
1068      */
1069     @Override
1070     public
1071 #if[!byte]
1072     final
1073 #end[!byte]
1074     $Type$Buffer position(int newPosition) {
1075         super.position(newPosition);
1076         return this;
1077     }
1078     
1079     /**
1080      * {@inheritDoc}
1081      * @since 9
1082      */
1083     @Override
1084     public
1085 #if[!byte]
1086     final
1087 #end[!byte]
1088     $Type$Buffer limit(int newLimit) {
1089         super.limit(newLimit);
1090         return this;
1091     }
1092     
1093     /**
1094      * {@inheritDoc}
1095      * @since 9
1096      */
1097     @Override
1098     public 
1099 #if[!byte]
1100     final
1101 #end[!byte]
1102     $Type$Buffer mark() {
1103         super.mark();
1104         return this;
1105     }
1106 
1107     /**
1108      * {@inheritDoc}
1109      * @since 9
1110      */
1111     @Override
1112     public 
1113 #if[!byte]
1114     final
1115 #end[!byte]
1116     $Type$Buffer reset() {
1117         super.reset();
1118         return this;
1119     }
1120 
1121     /**
1122      * {@inheritDoc}
1123      * @since 9
1124      */
1125     @Override
1126     public 
1127 #if[!byte]
1128     final
1129 #end[!byte]
1130     $Type$Buffer clear() {
1131         super.clear();
1132         return this;
1133     }
1134 
1135     /**
1136      * {@inheritDoc}
1137      * @since 9
1138      */
1139     @Override
1140     public 
1141 #if[!byte]
1142     final
1143 #end[!byte]
1144     $Type$Buffer flip() {
1145         super.flip();
1146         return this;
1147     }
1148 
1149     /**
1150      * {@inheritDoc}
1151      * @since 9
1152      */
1153     @Override
1154     public 
1155 #if[!byte]
1156     final
1157 #end[!byte]
1158     $Type$Buffer rewind() {
1159         super.rewind();
1160         return this;
1161     }
1162 
1163     /**
1164      * Compacts this buffer&nbsp;&nbsp;<i>(optional operation)</i>.
1165      *
1166      * <p> The $type$s between the buffer's current position and its limit,
1167      * if any, are copied to the beginning of the buffer.  That is, the
1168      * $type$ at index <i>p</i>&nbsp;=&nbsp;{@code position()} is copied
1169      * to index zero, the $type$ at index <i>p</i>&nbsp;+&nbsp;1 is copied
1170      * to index one, and so forth until the $type$ at index
1171      * {@code limit()}&nbsp;-&nbsp;1 is copied to index


< prev index next >