Skip to content

Commit b79f370

Browse files
authored
Merge pull request #315 from scijava/improve-byteslocation-javadoc
BytesLocation: improve javadoc
2 parents 80ce9ac + 31e6c1b commit b79f370

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/main/java/org/scijava/io/location/BytesLocation.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434

3535
import org.scijava.io.ByteArrayByteBank;
3636
import org.scijava.io.ByteBank;
37+
import org.scijava.io.handle.DataHandle;
3738
import org.scijava.util.ByteArray;
3839

3940
/**
@@ -57,8 +58,9 @@ public BytesLocation(final ByteBank bytes) {
5758
}
5859

5960
/**
60-
* Creates a {@link BytesLocation} backed by a {@link ByteArrayByteBank}
61-
* with the specified initial capacity.
61+
* Creates a {@link BytesLocation} backed by a {@link ByteArrayByteBank} with
62+
* the specified initial capacity, but with a reported size of 0. This method
63+
* can be used to avoid needing to grow the underlying {@link ByteBank}.
6264
*/
6365
public BytesLocation(final int initialCapacity) {
6466
this.bytes = new ByteArrayByteBank(initialCapacity);
@@ -84,7 +86,11 @@ public BytesLocation(final byte[] bytes) {
8486

8587
/**
8688
* Creates a {@link BytesLocation} backed by a {@link ByteArrayByteBank} with
87-
* the specified initial capacity.
89+
* the specified initial capacity and the provided data.
90+
*
91+
* @param bytes the bytes to copy into the new {@link BytesLocation}
92+
* @param offset the offset in the bytes array to start copying from
93+
* @param length the number of bytes to copy, starting from the offset
8894
*/
8995
public BytesLocation(final byte[] bytes, final int offset,
9096
final int length)

0 commit comments

Comments
 (0)