org.apache.directory.shared.asn1.util
Class IntegerDecoder

java.lang.Object
  extended byorg.apache.directory.shared.asn1.util.IntegerDecoder

public class IntegerDecoder
extends java.lang.Object

Parse and decode an Integer value.

Author:
Apache Directory Project

Field Summary
private static int[] MASK
           
 
Constructor Summary
IntegerDecoder()
           
 
Method Summary
static int parse(Value value)
          Parse a byte buffer and send back an integer
static int parse(Value value, int min, int max)
          Parse a byte buffer and send back an integer, controling that this number is in a specified interval.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MASK

private static final int[] MASK
Constructor Detail

IntegerDecoder

public IntegerDecoder()
Method Detail

parse

public static int parse(Value value,
                        int min,
                        int max)
                 throws IntegerDecoderException
Parse a byte buffer and send back an integer, controling that this number is in a specified interval.

Parameters:
value - The byte buffer to parse
min - Lowest value allowed, included
max - Highest value allowed, included
Returns:
An integer
Throws:
IntegerDecoderException - Thrown if the byte stream does not contains an integer

parse

public static int parse(Value value)
                 throws IntegerDecoderException
Parse a byte buffer and send back an integer

Parameters:
value - The byte buffer to parse
Returns:
An integer
Throws:
IntegerDecoderException - Thrown if the byte stream does not contains an integer


Copyright © 2003-2006 . All Rights Reserved.