@@ -25,7 +25,6 @@ This file is part of the iText (R) project.
2525import java .nio .ByteOrder ;
2626import java .nio .FloatBuffer ;
2727
28-
2928/**
3029 * Wrapper class around {@link java.nio.FloatBuffer}.
3130 */
@@ -45,23 +44,24 @@ public FloatBufferWrapper(FloatBuffer floatBuffer) {
4544 /**
4645 * Returns {@link FloatBuffer} that backs this buffer.
4746 *
48- * <p> Modifications to this buffer's content will cause the returned
47+ * <p>
48+ * Modifications to this buffer's content will cause the returned
4949 * buffer's content to be modified, and vice versa.
5050 *
51- * @return The array that backs this buffer
51+ * @return the array that backs this buffer
5252 */
5353 public FloatBuffer getFloatBuffer () {
5454 return floatBuffer ;
5555 }
5656
5757 /**
58- * Returns the float array that backs this
59- * buffer.
58+ * Returns the float array that backs this buffer.
6059 *
61- * <p> Modifications to this buffer's content will cause the returned
60+ * <p>
61+ * Modifications to this buffer's content will cause the returned
6262 * array's content to be modified, and vice versa.
6363 *
64- * @return The array that backs this buffer
64+ * @return the array that backs this buffer
6565 */
6666 public float [] array () {
6767 return floatBuffer .array ();
@@ -71,10 +71,11 @@ public float[] array() {
7171 * Returns the offset within this buffer's backing array of the first
7272 * element of the buffer.
7373 *
74- * <p> If this buffer is backed by an array then buffer position
74+ * <p>
75+ * If this buffer is backed by an array then buffer position
7576 * corresponds to array index position.
7677 *
77- * @return The offset within this buffer's array
78+ * @return the offset within this buffer's array
7879 * of the first element of the buffer
7980 */
8081 public int arrayOffset () {
@@ -85,7 +86,7 @@ public int arrayOffset() {
8586 * Relative get method. Reads the float at this buffer's
8687 * current position, and then increments the position.
8788 *
88- * @return The float at the buffer's current position
89+ * @return the float at the buffer's current position
8990 */
9091 public float get () {
9192 return floatBuffer .get ();
@@ -94,24 +95,24 @@ public float get() {
9495 /**
9596 * Absolute get method. Reads the float at the given index.
9697 *
97- * @param index The index from which the float will be read
98+ * @param index the index from which the float will be read
9899 *
99- * @return The float at the given index
100+ * @return the float at the given index
100101 */
101102 public float get (int index ) {
102103 return floatBuffer .get (index );
103104 }
104105
105-
106106 /**
107107 * Relative bulk <i>get</i> method.
108108 *
109- * <p> This method transfers floats from this buffer into the given
109+ * <p>
110+ * This method transfers floats from this buffer into the given
110111 * destination array.
111112 *
112- * @param dst The destination array
113+ * @param dst the destination array
113114 *
114- * @return This buffer
115+ * @return this buffer
115116 */
116117 public FloatBufferWrapper get (float [] dst ) {
117118 floatBuffer .get (dst );
@@ -121,11 +122,12 @@ public FloatBufferWrapper get(float[] dst) {
121122 /**
122123 * Rewinds this buffer. The position is set to zero.
123124 *
124- * <p> Invoke this method before a sequence of channel-write or get
125+ * <p>
126+ * Invoke this method before a sequence of channel-write or get
125127 * operations, assuming that the limit has already been set
126128 * appropriately.
127129 *
128- * @return This buffer
130+ * @return this buffer
129131 */
130132 public FloatBufferWrapper rewind () {
131133 floatBuffer .rewind ();
@@ -135,34 +137,54 @@ public FloatBufferWrapper rewind() {
135137 /**
136138 * Relative put method.
137139 *
138- * <p> Writes the given float into this buffer at the current
140+ * <p>
141+ * Writes the given float into this buffer at the current
139142 * position, and then increments the position.
140143 *
141- * @param value The float to be written
144+ * @param value the float to be written
142145 *
143- * @return This buffer
146+ * @return this buffer
144147 */
145148 public FloatBufferWrapper put (float value ) {
146149 floatBuffer .put (value );
147150 return this ;
148151 }
149152
153+ /**
154+ * Relative bulk put method.
155+ *
156+ * <p>
157+ * This method transfers floats into this buffer from the given source array.
158+ *
159+ * @param src the array from which floats are to be read
160+ * @param offset the offset within the array of the first float to be read;
161+ * must be non-negative and no larger than {@code array.length}
162+ * @param length the number of floats to be read from the given array;
163+ * must be non-negative and no larger than {@code array.length - offset}
164+ *
165+ * @return this buffer
166+ */
167+ public FloatBufferWrapper put (float [] src , int offset , int length ) {
168+ floatBuffer .put (src , offset , length );
169+ return this ;
170+ }
171+
150172 /**
151173 * Returns this buffer's limit.
152174 *
153- * @return The limit of this buffer
175+ * @return the limit of this buffer
154176 */
155177 public int limit () {
156178 return floatBuffer .limit ();
157179 }
158180
159181 /**
160- * Sets this buffer's limit. If the position is larger than the new limit
182+ * Sets this buffer's limit. If the position is larger than the new limit
161183 * then it is set to the new limit.
162184 *
163- * @param newLimit The new limit value; must be non-negative and no larger than this buffer's capacity
185+ * @param newLimit the new limit value; must be non-negative and no larger than this buffer's capacity
164186 *
165- * @return This buffer
187+ * @return this buffer
166188 */
167189 public FloatBufferWrapper limit (int newLimit ) {
168190 floatBuffer .limit (newLimit );
@@ -172,24 +194,25 @@ public FloatBufferWrapper limit(int newLimit) {
172194 /**
173195 * Creates a new float buffer that shares this buffer's content.
174196 *
175- * <p> The content of the new buffer will be that of this buffer. Changes
197+ * <p>
198+ * The content of the new buffer will be that of this buffer. Changes
176199 * to this buffer's content will be visible in the new buffer, and vice
177200 * versa; the two buffers' position and limit will be
178201 * independent.
179202 *
180- * <p> The new buffer's capacity, limit, position and byte order will be identical to those of this buffer.
203+ * <p>
204+ * The new buffer's capacity, limit, position and byte order will be identical to those of this buffer.
181205 *
182- * @return The new float buffer
206+ * @return the new float buffer
183207 */
184208 public FloatBufferWrapper duplicate () {
185209 return new FloatBufferWrapper (floatBuffer .duplicate ());
186210 }
187211
188212 /**
189- * Returns the number of elements between the current position and the
190- * limit.
213+ * Returns the number of elements between the current position and the limit.
191214 *
192- * @return The number of elements remaining in this buffer
215+ * @return the number of elements remaining in this buffer
193216 */
194217 public int remaining () {
195218 return floatBuffer .remaining ();
@@ -198,9 +221,9 @@ public int remaining() {
198221 /**
199222 * Sets this buffer's position.
200223 *
201- * @param newPosition The new position value; must be non-negative and no larger than the current limit
224+ * @param newPosition the new position value; must be non-negative and no larger than the current limit
202225 *
203- * @return This buffer
226+ * @return this buffer
204227 */
205228 public FloatBufferWrapper position (int newPosition ) {
206229 floatBuffer .position (newPosition );
@@ -212,15 +235,17 @@ public FloatBufferWrapper position(int newPosition) {
212235 * Creates a new float buffer whose content is a shared subsequence of
213236 * this buffer's content.
214237 *
215- * <p> The content of the new buffer will start at this buffer's current
238+ * <p>
239+ * The content of the new buffer will start at this buffer's current
216240 * position. Changes to this buffer's content will be visible in the new
217241 * buffer, and vice versa; the two buffers' position and limit values will be independent.
218242 *
219- * <p> The new buffer's position will be zero, its capacity and its limit
243+ * <p>
244+ * The new buffer's position will be zero, its capacity and its limit
220245 * will be the number of floats remaining in this buffer and its byte order
221246 * will be identical to that of this buffer.
222247 *
223- * @return The new float buffer
248+ * @return the new float buffer
224249 */
225250 public FloatBufferWrapper slice () {
226251 return new FloatBufferWrapper (floatBuffer .slice ());
@@ -229,16 +254,17 @@ public FloatBufferWrapper slice() {
229254 /**
230255 * Wraps a float array into a buffer.
231256 *
232- * <p> The new buffer will be backed by the given float array;
257+ * <p>
258+ * The new buffer will be backed by the given float array;
233259 * that is, modifications to the buffer will cause the array to be modified
234260 * and vice versa. The new buffer's capacity and limit will be
235261 * {@code array.length}, its position will be zero and its byte order
236262 * will be the {@link ByteOrder#nativeOrder native order} of the underlying hardware.
237263 * Its {@link #array backing array} will be the given array, and its {@link #arrayOffset array offset} will be zero.
238264 *
239- * @param array The array that will back this buffer
265+ * @param array the array that will back this buffer
240266 *
241- * @return The new float buffer
267+ * @return the new float buffer
242268 */
243269 public static FloatBufferWrapper wrap (float [] array ) {
244270 return new FloatBufferWrapper (FloatBuffer .wrap (array ));
@@ -247,17 +273,18 @@ public static FloatBufferWrapper wrap(float[] array) {
247273 /**
248274 * Allocates a new float buffer.
249275 *
250- * <p> The new buffer's position will be zero, its limit will be its
276+ * <p>
277+ * The new buffer's position will be zero, its limit will be its
251278 * capacity, its mark will be undefined, each of its elements will be
252279 * initialized to zero, and its byte order will be
253280 * the {@link ByteOrder#nativeOrder native order} of the underlying
254281 * hardware.
255282 * It will have a {@link #array backing array}, and its
256283 * {@link #arrayOffset array offset} will be zero.
257284 *
258- * @param capacity The new buffer's capacity, in floats
285+ * @param capacity the new buffer's capacity, in floats
259286 *
260- * @return The new float buffer
287+ * @return the new float buffer
261288 */
262289 public static FloatBufferWrapper allocate (int capacity ) {
263290 return new FloatBufferWrapper (FloatBuffer .allocate (capacity ));
0 commit comments