Class LongDecoder
- java.lang.Object
-
- org.apache.directory.api.asn1.ber.tlv.LongDecoder
-
public final class LongDecoder extends Object
Parse and decode a Long value.- Author:
- Apache Directory Project
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static longparse(BerValue value)Parse a byte buffer and send back an integerstatic longparse(BerValue value, long min, long max)Parse a byte buffer and send back an long, controlling that this number is in a specified interval.static longparseLong(BerValue value)Helper method used to parse the long.
-
-
-
Method Detail
-
parse
public static long parse(BerValue value, long min, long max) throws LongDecoderException
Parse a byte buffer and send back an long, controlling that this number is in a specified interval.- Parameters:
value- The byte buffer to parsemin- Lowest value allowed, includedmax- Highest value allowed, included- Returns:
- An integer
- Throws:
LongDecoderException- Thrown if the byte stream does not contains an integer
-
parse
public static long parse(BerValue value) throws LongDecoderException
Parse a byte buffer and send back an integer- Parameters:
value- The byte buffer to parse- Returns:
- An integer
- Throws:
LongDecoderException- Thrown if the byte stream does not contains an integer
-
parseLong
public static long parseLong(BerValue value) throws LongDecoderException
Helper method used to parse the long. We don't check any minimal or maximal bound.- Parameters:
value- The value to parse to a long- Returns:
- The decoded long
- Throws:
LongDecoderException- If we failed to decode a long
-
-