mirror of
https://github.com/revanced/smali.git
synced 2025-06-13 04:27:38 +02:00
whitespace fixes
git-svn-id: https://smali.googlecode.com/svn/trunk@501 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
@ -322,7 +322,7 @@ public class AnnotationDirectoryItem extends Item<AnnotationDirectoryItem> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Iterates over the field annotations, calling delegate.processFieldAnnotations for each
|
* Iterates over the field annotations, calling delegate.processFieldAnnotations for each
|
||||||
* @param delegate the delegate to call
|
* @param delegate the delegate to call
|
||||||
*/
|
*/
|
||||||
public void iterateFieldAnnotations(FieldAnnotationIteratorDelegate delegate) {
|
public void iterateFieldAnnotations(FieldAnnotationIteratorDelegate delegate) {
|
||||||
@ -364,7 +364,7 @@ public class AnnotationDirectoryItem extends Item<AnnotationDirectoryItem> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Iterates over the parameter annotations, calling delegate.processParameterAnnotations for each
|
* Iterates over the parameter annotations, calling delegate.processParameterAnnotations for each
|
||||||
* @param delegate the delegate to call
|
* @param delegate the delegate to call
|
||||||
*/
|
*/
|
||||||
public void iterateParameterAnnotations(ParameterAnnotationIteratorDelegate delegate) {
|
public void iterateParameterAnnotations(ParameterAnnotationIteratorDelegate delegate) {
|
||||||
|
@ -47,7 +47,7 @@ public class AnnotationEncodedValue extends AnnotationEncodedSubValue {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new <code>AnnotationEncodedValue</code> with the given values. names and values must be the same
|
* Constructs a new <code>AnnotationEncodedValue</code> with the given values. names and values must be the same
|
||||||
* length, and must be sorted according to the name
|
* length, and must be sorted according to the name
|
||||||
* @param annotationType The type of the annotation
|
* @param annotationType The type of the annotation
|
||||||
* @param names An array of the names of the elements of the annotation
|
* @param names An array of the names of the elements of the annotation
|
||||||
* @param values An array of the values of the elements on the annotation
|
* @param values An array of the values of the elements on the annotation
|
||||||
|
@ -32,7 +32,7 @@ import org.jf.dexlib.Util.AnnotatedOutput;
|
|||||||
|
|
||||||
public class BooleanEncodedValue extends EncodedValue {
|
public class BooleanEncodedValue extends EncodedValue {
|
||||||
/**
|
/**
|
||||||
* The dupliton values
|
* The dupliton values
|
||||||
*/
|
*/
|
||||||
public static final BooleanEncodedValue TrueValue = new BooleanEncodedValue(true);
|
public static final BooleanEncodedValue TrueValue = new BooleanEncodedValue(true);
|
||||||
public static final BooleanEncodedValue FalseValue = new BooleanEncodedValue(false);
|
public static final BooleanEncodedValue FalseValue = new BooleanEncodedValue(false);
|
||||||
@ -51,7 +51,7 @@ public class BooleanEncodedValue extends EncodedValue {
|
|||||||
* Gets the <code>BooleanEncodedValue</code> for the given valueArg value. The high 3 bits of the first byte should
|
* Gets the <code>BooleanEncodedValue</code> for the given valueArg value. The high 3 bits of the first byte should
|
||||||
* be passed as the valueArg parameter
|
* be passed as the valueArg parameter
|
||||||
* @param valueArg The high 3 bits of the first byte of this encoded value
|
* @param valueArg The high 3 bits of the first byte of this encoded value
|
||||||
* @return the <code>BooleanEncodedValue</code> for the given valueArg value
|
* @return the <code>BooleanEncodedValue</code> for the given valueArg value
|
||||||
*/
|
*/
|
||||||
protected static BooleanEncodedValue getBooleanEncodedValue(byte valueArg) {
|
protected static BooleanEncodedValue getBooleanEncodedValue(byte valueArg) {
|
||||||
if (valueArg == 0) {
|
if (valueArg == 0) {
|
||||||
@ -59,7 +59,7 @@ public class BooleanEncodedValue extends EncodedValue {
|
|||||||
} else if (valueArg == 1) {
|
} else if (valueArg == 1) {
|
||||||
return TrueValue;
|
return TrueValue;
|
||||||
}
|
}
|
||||||
throw new RuntimeException("valueArg must be either 0 or 1");
|
throw new RuntimeException("valueArg must be either 0 or 1");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -41,7 +41,7 @@ public class ByteEncodedValue extends EncodedValue {
|
|||||||
* @param in The <code>Input</code> object to read from
|
* @param in The <code>Input</code> object to read from
|
||||||
*/
|
*/
|
||||||
protected ByteEncodedValue(Input in) {
|
protected ByteEncodedValue(Input in) {
|
||||||
value = (byte)EncodedValueUtils.decodeSignedIntegralValue(in.readBytes(1));
|
value = (byte)EncodedValueUtils.decodeSignedIntegralValue(in.readBytes(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -59,7 +59,7 @@ public class ByteEncodedValue extends EncodedValue {
|
|||||||
out.annotate(1, "value: 0x" + Integer.toHexString(value) + " (" + value + ")");
|
out.annotate(1, "value: 0x" + Integer.toHexString(value) + " (" + value + ")");
|
||||||
}
|
}
|
||||||
out.writeByte(ValueType.VALUE_BYTE.value);
|
out.writeByte(ValueType.VALUE_BYTE.value);
|
||||||
out.writeByte(value);
|
out.writeByte(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
|
@ -44,7 +44,7 @@ public class DoubleEncodedValue extends EncodedValue {
|
|||||||
*/
|
*/
|
||||||
protected DoubleEncodedValue(Input in, byte valueArg) {
|
protected DoubleEncodedValue(Input in, byte valueArg) {
|
||||||
long longValue = EncodedValueUtils.decodeRightZeroExtendedValue(in.readBytes(valueArg + 1));
|
long longValue = EncodedValueUtils.decodeRightZeroExtendedValue(in.readBytes(valueArg + 1));
|
||||||
value = Double.longBitsToDouble(longValue);
|
value = Double.longBitsToDouble(longValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -100,9 +100,9 @@ public abstract class EncodedValue implements Comparable<EncodedValue> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Compare the value of this <code>EncodedValue</code> against the value of the given <EncodedValue>, which
|
* Compare the value of this <code>EncodedValue</code> against the value of the given <EncodedValue>, which
|
||||||
* is guaranteed to be of the same type as this <code>EncodedValue</code>
|
* is guaranteed to be of the same type as this <code>EncodedValue</code>
|
||||||
* @param o The <code>EncodedValue</code> to compare against
|
* @param o The <code>EncodedValue</code> to compare against
|
||||||
* @return A standard comparison integer value
|
* @return A standard comparison integer value
|
||||||
*/
|
*/
|
||||||
protected abstract int compareValue(EncodedValue o);
|
protected abstract int compareValue(EncodedValue o);
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ public class FloatEncodedValue extends EncodedValue {
|
|||||||
*/
|
*/
|
||||||
protected FloatEncodedValue(Input in, byte valueArg) {
|
protected FloatEncodedValue(Input in, byte valueArg) {
|
||||||
long longValue = EncodedValueUtils.decodeRightZeroExtendedValue(in.readBytes(valueArg + 1));
|
long longValue = EncodedValueUtils.decodeRightZeroExtendedValue(in.readBytes(valueArg + 1));
|
||||||
value = Float.intBitsToFloat((int)((longValue >> 32) & 0xFFFFFFFFL));
|
value = Float.intBitsToFloat((int)((longValue >> 32) & 0xFFFFFFFFL));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -43,7 +43,7 @@ public class IntEncodedValue extends EncodedValue {
|
|||||||
* @param valueArg The high 3 bits of the first byte of this encoded value
|
* @param valueArg The high 3 bits of the first byte of this encoded value
|
||||||
*/
|
*/
|
||||||
protected IntEncodedValue(Input in, byte valueArg) {
|
protected IntEncodedValue(Input in, byte valueArg) {
|
||||||
value = (int)EncodedValueUtils.decodeSignedIntegralValue(in.readBytes(valueArg+1));
|
value = (int)EncodedValueUtils.decodeSignedIntegralValue(in.readBytes(valueArg+1));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -46,7 +46,7 @@ public class NullEncodedValue extends EncodedValue {
|
|||||||
public void writeValue(AnnotatedOutput out) {
|
public void writeValue(AnnotatedOutput out) {
|
||||||
if (out.annotates()) {
|
if (out.annotates()) {
|
||||||
out.annotate("value_type=" + ValueType.VALUE_NULL.name() + ",value_arg=0");
|
out.annotate("value_type=" + ValueType.VALUE_NULL.name() + ",value_arg=0");
|
||||||
}
|
}
|
||||||
out.writeByte(ValueType.VALUE_NULL.value);
|
out.writeByte(ValueType.VALUE_NULL.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ public class ShortEncodedValue extends EncodedValue {
|
|||||||
* @param valueArg The high 3 bits of the first byte of this encoded value
|
* @param valueArg The high 3 bits of the first byte of this encoded value
|
||||||
*/
|
*/
|
||||||
protected ShortEncodedValue(Input in, byte valueArg) {
|
protected ShortEncodedValue(Input in, byte valueArg) {
|
||||||
value = (short) EncodedValueUtils.decodeSignedIntegralValue(in.readBytes(valueArg+1));
|
value = (short) EncodedValueUtils.decodeSignedIntegralValue(in.readBytes(valueArg+1));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -35,7 +35,7 @@ import java.util.ArrayList;
|
|||||||
/**
|
/**
|
||||||
* Implementation of {@link AnnotatedOutput} which stores the written data
|
* Implementation of {@link AnnotatedOutput} which stores the written data
|
||||||
* into a <code>byte[]</code>.
|
* into a <code>byte[]</code>.
|
||||||
*
|
*
|
||||||
* <p><b>Note:</b> As per the {@link Output} interface, multi-byte
|
* <p><b>Note:</b> As per the {@link Output} interface, multi-byte
|
||||||
* writes all use little-endian order.</p>
|
* writes all use little-endian order.</p>
|
||||||
*/
|
*/
|
||||||
@ -43,7 +43,7 @@ public final class ByteArrayAnnotatedOutput
|
|||||||
implements AnnotatedOutput {
|
implements AnnotatedOutput {
|
||||||
/** default size for stretchy instances */
|
/** default size for stretchy instances */
|
||||||
private static final int DEFAULT_SIZE = 1000;
|
private static final int DEFAULT_SIZE = 1000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* whether the instance is stretchy, that is, whether its array
|
* whether the instance is stretchy, that is, whether its array
|
||||||
* may be resized to increase capacity
|
* may be resized to increase capacity
|
||||||
@ -61,7 +61,7 @@ public final class ByteArrayAnnotatedOutput
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* null-ok; list of annotations, or <code>null</code> if this instance
|
* null-ok; list of annotations, or <code>null</code> if this instance
|
||||||
* isn't keeping them
|
* isn't keeping them
|
||||||
*/
|
*/
|
||||||
private ArrayList<Annotation> annotations;
|
private ArrayList<Annotation> annotations;
|
||||||
|
|
||||||
@ -70,7 +70,7 @@ public final class ByteArrayAnnotatedOutput
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* >= 8 (if used); the number of bytes of hex output to use
|
* >= 8 (if used); the number of bytes of hex output to use
|
||||||
* in annotations
|
* in annotations
|
||||||
*/
|
*/
|
||||||
private int hexCols;
|
private int hexCols;
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ public final class ByteArrayAnnotatedOutput
|
|||||||
* particular, no reallocation will occur in order to expand the
|
* particular, no reallocation will occur in order to expand the
|
||||||
* capacity of the resulting instance. Also, the constructed
|
* capacity of the resulting instance. Also, the constructed
|
||||||
* instance does not keep annotations by default.
|
* instance does not keep annotations by default.
|
||||||
*
|
*
|
||||||
* @param data non-null; data array to use for output
|
* @param data non-null; data array to use for output
|
||||||
*/
|
*/
|
||||||
public ByteArrayAnnotatedOutput(byte[] data) {
|
public ByteArrayAnnotatedOutput(byte[] data) {
|
||||||
@ -101,7 +101,7 @@ public final class ByteArrayAnnotatedOutput
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal constructor.
|
* Internal constructor.
|
||||||
*
|
*
|
||||||
* @param data non-null; data array to use for output
|
* @param data non-null; data array to use for output
|
||||||
* @param stretchy whether the instance is to be stretchy
|
* @param stretchy whether the instance is to be stretchy
|
||||||
*/
|
*/
|
||||||
@ -122,9 +122,9 @@ public final class ByteArrayAnnotatedOutput
|
|||||||
/**
|
/**
|
||||||
* Gets the underlying <code>byte[]</code> of this instance, which
|
* Gets the underlying <code>byte[]</code> of this instance, which
|
||||||
* may be larger than the number of bytes written
|
* may be larger than the number of bytes written
|
||||||
*
|
*
|
||||||
* @see #toByteArray
|
* @see #toByteArray
|
||||||
*
|
*
|
||||||
* @return non-null; the <code>byte[]</code>
|
* @return non-null; the <code>byte[]</code>
|
||||||
*/
|
*/
|
||||||
public byte[] getArray() {
|
public byte[] getArray() {
|
||||||
@ -135,9 +135,9 @@ public final class ByteArrayAnnotatedOutput
|
|||||||
* Constructs and returns a new <code>byte[]</code> that contains
|
* Constructs and returns a new <code>byte[]</code> that contains
|
||||||
* the written contents exactly (that is, with no extra unwritten
|
* the written contents exactly (that is, with no extra unwritten
|
||||||
* bytes at the end).
|
* bytes at the end).
|
||||||
*
|
*
|
||||||
* @see #getArray
|
* @see #getArray
|
||||||
*
|
*
|
||||||
* @return non-null; an appropriately-constructed array
|
* @return non-null; an appropriately-constructed array
|
||||||
*/
|
*/
|
||||||
public byte[] toByteArray() {
|
public byte[] toByteArray() {
|
||||||
@ -274,7 +274,7 @@ public final class ByteArrayAnnotatedOutput
|
|||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
public void write(ByteArray bytes) {
|
public void write(ByteArray bytes) {
|
||||||
int blen = bytes.size();
|
int blen = bytes.size();
|
||||||
@ -301,7 +301,7 @@ public final class ByteArrayAnnotatedOutput
|
|||||||
// twos-complement math trick: ((x < 0) || (y < 0)) <=> ((x|y) < 0)
|
// twos-complement math trick: ((x < 0) || (y < 0)) <=> ((x|y) < 0)
|
||||||
if (((offset | length | end) < 0) || (bytesEnd > bytes.length)) {
|
if (((offset | length | end) < 0) || (bytesEnd > bytes.length)) {
|
||||||
throw new IndexOutOfBoundsException("bytes.length " +
|
throw new IndexOutOfBoundsException("bytes.length " +
|
||||||
bytes.length + "; " +
|
bytes.length + "; " +
|
||||||
offset + "..!" + end);
|
offset + "..!" + end);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -449,7 +449,7 @@ public final class ByteArrayAnnotatedOutput
|
|||||||
* Indicates that this instance should keep annotations. This method may
|
* Indicates that this instance should keep annotations. This method may
|
||||||
* be called only once per instance, and only before any data has been
|
* be called only once per instance, and only before any data has been
|
||||||
* written to the it.
|
* written to the it.
|
||||||
*
|
*
|
||||||
* @param annotationWidth >= 40; the desired maximum annotation width
|
* @param annotationWidth >= 40; the desired maximum annotation width
|
||||||
* @param verbose whether or not to indicate verbose annotations
|
* @param verbose whether or not to indicate verbose annotations
|
||||||
*/
|
*/
|
||||||
@ -504,7 +504,7 @@ public final class ByteArrayAnnotatedOutput
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Writes the annotated content of this instance to the given writer.
|
* Writes the annotated content of this instance to the given writer.
|
||||||
*
|
*
|
||||||
* @param out non-null; where to write to
|
* @param out non-null; where to write to
|
||||||
*/
|
*/
|
||||||
public void writeAnnotationsTo(Writer out) throws IOException {
|
public void writeAnnotationsTo(Writer out) throws IOException {
|
||||||
@ -573,7 +573,7 @@ public final class ByteArrayAnnotatedOutput
|
|||||||
/**
|
/**
|
||||||
* Reallocates the underlying array if necessary. Calls to this method
|
* Reallocates the underlying array if necessary. Calls to this method
|
||||||
* should be guarded by a test of {@link #stretchy}.
|
* should be guarded by a test of {@link #stretchy}.
|
||||||
*
|
*
|
||||||
* @param desiredSize >= 0; the desired minimum total size of the array
|
* @param desiredSize >= 0; the desired minimum total size of the array
|
||||||
*/
|
*/
|
||||||
private void ensureCapacity(int desiredSize) {
|
private void ensureCapacity(int desiredSize) {
|
||||||
@ -593,7 +593,7 @@ public final class ByteArrayAnnotatedOutput
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* >= 0; end of annotated range (exclusive);
|
* >= 0; end of annotated range (exclusive);
|
||||||
* <code>Integer.MAX_VALUE</code> if unclosed
|
* <code>Integer.MAX_VALUE</code> if unclosed
|
||||||
*/
|
*/
|
||||||
private int end;
|
private int end;
|
||||||
|
|
||||||
@ -604,7 +604,7 @@ public final class ByteArrayAnnotatedOutput
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs an instance.
|
* Constructs an instance.
|
||||||
*
|
*
|
||||||
* @param start >= 0; start of annotated range
|
* @param start >= 0; start of annotated range
|
||||||
* @param end >= start; end of annotated range (exclusive) or
|
* @param end >= start; end of annotated range (exclusive) or
|
||||||
* <code>Integer.MAX_VALUE</code> if unclosed
|
* <code>Integer.MAX_VALUE</code> if unclosed
|
||||||
@ -619,7 +619,7 @@ public final class ByteArrayAnnotatedOutput
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs an instance. It is initally unclosed.
|
* Constructs an instance. It is initally unclosed.
|
||||||
*
|
*
|
||||||
* @param start >= 0; start of annotated range
|
* @param start >= 0; start of annotated range
|
||||||
* @param text non-null; annotation text
|
* @param text non-null; annotation text
|
||||||
*/
|
*/
|
||||||
@ -630,7 +630,7 @@ public final class ByteArrayAnnotatedOutput
|
|||||||
/**
|
/**
|
||||||
* Sets the end as given, but only if the instance is unclosed;
|
* Sets the end as given, but only if the instance is unclosed;
|
||||||
* otherwise, do nothing.
|
* otherwise, do nothing.
|
||||||
*
|
*
|
||||||
* @param end >= start; the end
|
* @param end >= start; the end
|
||||||
*/
|
*/
|
||||||
public void setEndIfUnset(int end) {
|
public void setEndIfUnset(int end) {
|
||||||
@ -641,7 +641,7 @@ public final class ByteArrayAnnotatedOutput
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the end as given.
|
* Sets the end as given.
|
||||||
*
|
*
|
||||||
* @param end >= start; the end
|
* @param end >= start; the end
|
||||||
*/
|
*/
|
||||||
public void setEnd(int end) {
|
public void setEnd(int end) {
|
||||||
@ -650,7 +650,7 @@ public final class ByteArrayAnnotatedOutput
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the start.
|
* Gets the start.
|
||||||
*
|
*
|
||||||
* @return the start
|
* @return the start
|
||||||
*/
|
*/
|
||||||
public int getStart() {
|
public int getStart() {
|
||||||
@ -659,7 +659,7 @@ public final class ByteArrayAnnotatedOutput
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the end.
|
* Gets the end.
|
||||||
*
|
*
|
||||||
* @return the end
|
* @return the end
|
||||||
*/
|
*/
|
||||||
public int getEnd() {
|
public int getEnd() {
|
||||||
@ -668,7 +668,7 @@ public final class ByteArrayAnnotatedOutput
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the text.
|
* Gets the text.
|
||||||
*
|
*
|
||||||
* @return non-null; the text
|
* @return non-null; the text
|
||||||
*/
|
*/
|
||||||
public String getText() {
|
public String getText() {
|
||||||
|
@ -21,7 +21,7 @@ import java.util.ArrayList;
|
|||||||
/**
|
/**
|
||||||
* Implementation of {@link AnnotatedOutput} which stores the written data
|
* Implementation of {@link AnnotatedOutput} which stores the written data
|
||||||
* into a <code>byte[]</code>.
|
* into a <code>byte[]</code>.
|
||||||
*
|
*
|
||||||
* <p><b>Note:</b> As per the {@link Output} interface, multi-byte
|
* <p><b>Note:</b> As per the {@link Output} interface, multi-byte
|
||||||
* writes all use little-endian order.</p>
|
* writes all use little-endian order.</p>
|
||||||
*/
|
*/
|
||||||
@ -29,7 +29,7 @@ public final class ByteArrayOutput implements Output
|
|||||||
{
|
{
|
||||||
/** default size for stretchy instances */
|
/** default size for stretchy instances */
|
||||||
private static final int DEFAULT_SIZE = 1000;
|
private static final int DEFAULT_SIZE = 1000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* whether the instance is stretchy, that is, whether its array
|
* whether the instance is stretchy, that is, whether its array
|
||||||
* may be resized to increase capacity
|
* may be resized to increase capacity
|
||||||
@ -47,7 +47,7 @@ public final class ByteArrayOutput implements Output
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* null-ok; list of annotations, or <code>null</code> if this instance
|
* null-ok; list of annotations, or <code>null</code> if this instance
|
||||||
* isn't keeping them
|
* isn't keeping them
|
||||||
*/
|
*/
|
||||||
private ArrayList<Annotation> annotations;
|
private ArrayList<Annotation> annotations;
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ public final class ByteArrayOutput implements Output
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* >= 8 (if used); the number of bytes of hex output to use
|
* >= 8 (if used); the number of bytes of hex output to use
|
||||||
* in annotations
|
* in annotations
|
||||||
*/
|
*/
|
||||||
private int hexCols;
|
private int hexCols;
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ public final class ByteArrayOutput implements Output
|
|||||||
* particular, no reallocation will occur in order to expand the
|
* particular, no reallocation will occur in order to expand the
|
||||||
* capacity of the resulting instance. Also, the constructed
|
* capacity of the resulting instance. Also, the constructed
|
||||||
* instance does not keep annotations by default.
|
* instance does not keep annotations by default.
|
||||||
*
|
*
|
||||||
* @param data non-null; data array to use for output
|
* @param data non-null; data array to use for output
|
||||||
*/
|
*/
|
||||||
public ByteArrayOutput(byte[] data) {
|
public ByteArrayOutput(byte[] data) {
|
||||||
@ -84,7 +84,7 @@ public final class ByteArrayOutput implements Output
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal constructor.
|
* Internal constructor.
|
||||||
*
|
*
|
||||||
* @param data non-null; data array to use for output
|
* @param data non-null; data array to use for output
|
||||||
* @param stretchy whether the instance is to be stretchy
|
* @param stretchy whether the instance is to be stretchy
|
||||||
*/
|
*/
|
||||||
@ -105,9 +105,9 @@ public final class ByteArrayOutput implements Output
|
|||||||
/**
|
/**
|
||||||
* Gets the underlying <code>byte[]</code> of this instance, which
|
* Gets the underlying <code>byte[]</code> of this instance, which
|
||||||
* may be larger than the number of bytes written
|
* may be larger than the number of bytes written
|
||||||
*
|
*
|
||||||
* @see #toByteArray
|
* @see #toByteArray
|
||||||
*
|
*
|
||||||
* @return non-null; the <code>byte[]</code>
|
* @return non-null; the <code>byte[]</code>
|
||||||
*/
|
*/
|
||||||
public byte[] getArray() {
|
public byte[] getArray() {
|
||||||
@ -118,9 +118,9 @@ public final class ByteArrayOutput implements Output
|
|||||||
* Constructs and returns a new <code>byte[]</code> that contains
|
* Constructs and returns a new <code>byte[]</code> that contains
|
||||||
* the written contents exactly (that is, with no extra unwritten
|
* the written contents exactly (that is, with no extra unwritten
|
||||||
* bytes at the end).
|
* bytes at the end).
|
||||||
*
|
*
|
||||||
* @see #getArray
|
* @see #getArray
|
||||||
*
|
*
|
||||||
* @return non-null; an appropriately-constructed array
|
* @return non-null; an appropriately-constructed array
|
||||||
*/
|
*/
|
||||||
public byte[] toByteArray() {
|
public byte[] toByteArray() {
|
||||||
@ -256,7 +256,7 @@ public final class ByteArrayOutput implements Output
|
|||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
public void write(ByteArray bytes) {
|
public void write(ByteArray bytes) {
|
||||||
int blen = bytes.size();
|
int blen = bytes.size();
|
||||||
@ -283,7 +283,7 @@ public final class ByteArrayOutput implements Output
|
|||||||
// twos-complement math trick: ((x < 0) || (y < 0)) <=> ((x|y) < 0)
|
// twos-complement math trick: ((x < 0) || (y < 0)) <=> ((x|y) < 0)
|
||||||
if (((offset | length | end) < 0) || (bytesEnd > bytes.length)) {
|
if (((offset | length | end) < 0) || (bytesEnd > bytes.length)) {
|
||||||
throw new IndexOutOfBoundsException("bytes.length " +
|
throw new IndexOutOfBoundsException("bytes.length " +
|
||||||
bytes.length + "; " +
|
bytes.length + "; " +
|
||||||
offset + "..!" + end);
|
offset + "..!" + end);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -404,7 +404,7 @@ public final class ByteArrayOutput implements Output
|
|||||||
* Indicates that this instance should keep annotations. This method may
|
* Indicates that this instance should keep annotations. This method may
|
||||||
* be called only once per instance, and only before any data has been
|
* be called only once per instance, and only before any data has been
|
||||||
* written to the it.
|
* written to the it.
|
||||||
*
|
*
|
||||||
* @param annotationWidth >= 40; the desired maximum annotation width
|
* @param annotationWidth >= 40; the desired maximum annotation width
|
||||||
* @param verbose whether or not to indicate verbose annotations
|
* @param verbose whether or not to indicate verbose annotations
|
||||||
*/
|
*/
|
||||||
@ -468,7 +468,7 @@ public final class ByteArrayOutput implements Output
|
|||||||
/**
|
/**
|
||||||
* Reallocates the underlying array if necessary. Calls to this method
|
* Reallocates the underlying array if necessary. Calls to this method
|
||||||
* should be guarded by a test of {@link #stretchy}.
|
* should be guarded by a test of {@link #stretchy}.
|
||||||
*
|
*
|
||||||
* @param desiredSize >= 0; the desired minimum total size of the array
|
* @param desiredSize >= 0; the desired minimum total size of the array
|
||||||
*/
|
*/
|
||||||
private void ensureCapacity(int desiredSize) {
|
private void ensureCapacity(int desiredSize) {
|
||||||
@ -488,7 +488,7 @@ public final class ByteArrayOutput implements Output
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* >= 0; end of annotated range (exclusive);
|
* >= 0; end of annotated range (exclusive);
|
||||||
* <code>Integer.MAX_VALUE</code> if unclosed
|
* <code>Integer.MAX_VALUE</code> if unclosed
|
||||||
*/
|
*/
|
||||||
private int end;
|
private int end;
|
||||||
|
|
||||||
@ -497,7 +497,7 @@ public final class ByteArrayOutput implements Output
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs an instance.
|
* Constructs an instance.
|
||||||
*
|
*
|
||||||
* @param start >= 0; start of annotated range
|
* @param start >= 0; start of annotated range
|
||||||
* @param end >= start; end of annotated range (exclusive) or
|
* @param end >= start; end of annotated range (exclusive) or
|
||||||
* <code>Integer.MAX_VALUE</code> if unclosed
|
* <code>Integer.MAX_VALUE</code> if unclosed
|
||||||
@ -511,7 +511,7 @@ public final class ByteArrayOutput implements Output
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs an instance. It is initally unclosed.
|
* Constructs an instance. It is initally unclosed.
|
||||||
*
|
*
|
||||||
* @param start >= 0; start of annotated range
|
* @param start >= 0; start of annotated range
|
||||||
* @param text non-null; annotation text
|
* @param text non-null; annotation text
|
||||||
*/
|
*/
|
||||||
@ -522,7 +522,7 @@ public final class ByteArrayOutput implements Output
|
|||||||
/**
|
/**
|
||||||
* Sets the end as given, but only if the instance is unclosed;
|
* Sets the end as given, but only if the instance is unclosed;
|
||||||
* otherwise, do nothing.
|
* otherwise, do nothing.
|
||||||
*
|
*
|
||||||
* @param end >= start; the end
|
* @param end >= start; the end
|
||||||
*/
|
*/
|
||||||
public void setEndIfUnset(int end) {
|
public void setEndIfUnset(int end) {
|
||||||
@ -533,7 +533,7 @@ public final class ByteArrayOutput implements Output
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the end as given.
|
* Sets the end as given.
|
||||||
*
|
*
|
||||||
* @param end >= start; the end
|
* @param end >= start; the end
|
||||||
*/
|
*/
|
||||||
public void setEnd(int end) {
|
public void setEnd(int end) {
|
||||||
@ -542,7 +542,7 @@ public final class ByteArrayOutput implements Output
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the start.
|
* Gets the start.
|
||||||
*
|
*
|
||||||
* @return the start
|
* @return the start
|
||||||
*/
|
*/
|
||||||
public int getStart() {
|
public int getStart() {
|
||||||
@ -551,7 +551,7 @@ public final class ByteArrayOutput implements Output
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the end.
|
* Gets the end.
|
||||||
*
|
*
|
||||||
* @return the end
|
* @return the end
|
||||||
*/
|
*/
|
||||||
public int getEnd() {
|
public int getEnd() {
|
||||||
@ -560,7 +560,7 @@ public final class ByteArrayOutput implements Output
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the text.
|
* Gets the text.
|
||||||
*
|
*
|
||||||
* @return non-null; the text
|
* @return non-null; the text
|
||||||
*/
|
*/
|
||||||
public String getText() {
|
public String getText() {
|
||||||
|
Reference in New Issue
Block a user