aboutsummaryrefslogtreecommitdiff
path: root/src/main/model/asn1/ASN1Length.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/model/asn1/ASN1Length.java')
-rw-r--r--src/main/model/asn1/ASN1Length.java14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/main/model/asn1/ASN1Length.java b/src/main/model/asn1/ASN1Length.java
index e85689c..913b35a 100644
--- a/src/main/model/asn1/ASN1Length.java
+++ b/src/main/model/asn1/ASN1Length.java
@@ -4,8 +4,6 @@ import model.asn1.exceptions.ParseException;
import model.asn1.parsing.BytesReader;
import ui.Utils;
-import java.util.Arrays;
-
/**
* Represents the Length part in DER encoding. It appears after Tag and before Value. It represents the length of the
* encoded Value in bytes.
@@ -31,11 +29,11 @@ public class ASN1Length implements Encodable {
/**
* EFFECTS: Parse the length from the given DER input.
- * Throws {@link ParseException} if the input is invalid:
- * - Indefinite length
- * - Not enough bytes
- * - Initial byte 0b11111111 (See X.690$8.1.3.5)
- * - Value too long (compliant to RFC but unsupported by this program): multibyte and # of bytes > 3
+ * Throws {@link ParseException} if the input is invalid:
+ * - Indefinite length
+ * - Not enough bytes
+ * - Initial byte 0b11111111 (See X.690$8.1.3.5)
+ * - Value too long (compliant to RFC but unsupported by this program): multibyte and # of bytes > 3
* MODIFIES: reader (bytes are read, at least one byte, at most 5 bytes)
*/
public ASN1Length(BytesReader reader) throws ParseException {
@@ -78,7 +76,7 @@ public class ASN1Length implements Encodable {
// DER prefers the shortest form.
if (length <= 127) {
// Possible in a single byte.
- return new Byte[]{ (byte) length };
+ return new Byte[]{(byte) length};
} else {
// Big-endian encoding of the length. DER uses big-endian.
final Byte[] lengthBytes = Utils.valToByte(length);