@Retention(value=CLASS) @Target(value=PARAMETER) public @interface Out
In
for in-out
parameters. Example showing the configuration for
OutputStream.write(byte[], int, int)
.
@Override public abstract int read(@Out(arrayOffsetParameter = "off", arrayLengthParameter = "len", trimToResult = true) byte[] b, int off, int len);
Modifier and Type | Optional Element and Description |
---|---|
String |
arrayLengthParameter
Limits copying only to many of the elements given by the
arrayLengthParameter
parameter. |
String |
arrayOffsetParameter
Copy only a part of the array starting at offset given by the
arrayOffsetParameter
method parameter. |
boolean |
trimToResult
Limits copying only to method result number of elements.
|
public abstract String arrayOffsetParameter
arrayOffsetParameter
method parameter. By default, the whole array is copied. The arrayOffsetParameter
can
be used to improve the performance and copy only a part of the array over the boundary.public abstract String arrayLengthParameter
arrayLengthParameter
parameter. By default, the whole array is copied. The arrayLengthParameter
can be
used to improve the performance and copy only a part of the array over the boundary.public abstract boolean trimToResult
Out.arrayLengthParameter()
. When used, it's still
good to specify Out.arrayLengthParameter()
as an upper bound to limit allocated array
size.