Tabnine Logo
BER$MutableByte.setValue
Code IndexAdd Tabnine to your IDE (free)

How to use
setValue
method
in
org.snmp4j.asn1.BER$MutableByte

Best Java code snippets using org.snmp4j.asn1.BER$MutableByte.setValue (Showing top 20 results out of 315)

origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

public static BigInteger decodeBigInteger(BERInputStream is, MutableByte type)
    throws IOException
{
 int length;
 type.setValue((byte)is.read());
 if (type.value != 0x02) {
  throw new IOException("Wrong ASN.1 type. Not an INTEGER: "+type.value+
      getPositionMessage(is));
 }
 length = decodeLength(is);
 if (length < 0) {
  throw new IOException("Length greater than "+Integer.MAX_VALUE+" are not supported "+
      " for integers: "+getPositionMessage(is));
 }
 byte[] bytes = new byte[length];
 int actualRead = is.read(bytes);
 if (actualRead != length) {
  throw new IOException("Length of INTEGER ("+length+") is greater than number of bytes left in BER stream: "+
      actualRead);
 }
 return new BigInteger(bytes);
}
origin: org.snmp4j/snmp4j

public static BigInteger decodeBigInteger(BERInputStream is, MutableByte type)
    throws IOException
{
 int length;
 type.setValue((byte)is.read());
 if (type.value != 0x02) {
  throw new IOException("Wrong ASN.1 type. Not an INTEGER: "+type.value+
      getPositionMessage(is));
 }
 length = decodeLength(is);
 if (length < 0) {
  throw new IOException("Length greater than "+Integer.MAX_VALUE+" are not supported "+
      " for integers: "+getPositionMessage(is));
 }
 byte[] bytes = new byte[length];
 int actualRead = is.read(bytes);
 if (actualRead != length) {
  throw new IOException("Length of INTEGER ("+length+") is greater than number of bytes left in BER stream: "+
      actualRead);
 }
 return new BigInteger(bytes);
}
origin: OpenNMS/opennms

BigInteger value = BigInteger.ZERO;
type.setValue((byte)inputStream.read());
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

            getPositionMessage(is));
type.setValue(t);
return decodeLength(is, checkLength);
origin: org.snmp4j/snmp4j

            getPositionMessage(is));
type.setValue(t);
return decodeLength(is, checkLength);
origin: org.snmp4j/snmp4j

type.setValue((byte)is.read());
if ((type.value != 0x02) && (type.value != 0x46)) {
 throw new IOException("Wrong type. Not an integer 64: "+type.value+
origin: org.kaazing/snmp4j

type.setValue((byte)is.read());
if ((type.value != BER.OCTETSTRING) && (type.value != 0x24) &&
  (type.value != BER.IPADDRESS) && (type.value != BER.OPAQUE) &&
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

type.setValue((byte)is.read());
if ((type.value != 0x02) && (type.value != 0x46)) {
 throw new IOException("Wrong type. Not an integer 64: "+type.value+
origin: org.opennms.core.snmp/org.opennms.core.snmp.implementations.snmp4j

BigInteger value = BigInteger.ZERO;
type.setValue((byte)inputStream.read());
origin: org.snmp4j/snmp4j

public static int decodeInteger(BERInputStream is, MutableByte type)
  throws IOException
{
 int length;
 int value = 0;
 type.setValue((byte)is.read());
 if ((type.value != 0x02) && (type.value != 0x43) &&
   (type.value != 0x41)) {
  throw new IOException("Wrong ASN.1 type. Not an integer: "+type.value+
             getPositionMessage(is));
 }
 length = decodeLength(is);
 if (length > 4) {
  throw new IOException("Length greater than 32bit are not supported "+
             " for integers: "+getPositionMessage(is));
 }
 int b = is.read() & 0xFF;
 if ((b & 0x80) > 0) {
  value = -1; /* integer is negative */
 }
 while (length-- > 0) {
  value = (value << 8) | b;
  if (length > 0) {
   b = is.read();
  }
 }
 return value;
}
origin: org.kaazing/snmp4j

public static final int decodeInteger(BERInputStream is, MutableByte type)
  throws IOException
{
 int length;
 int value = 0;
 type.setValue((byte)is.read());
 if ((type.value != 0x02) && (type.value != 0x43) &&
   (type.value != 0x41)) {
  throw new IOException("Wrong ASN.1 type. Not an integer: "+type.value+
             getPositionMessage(is));
 }
 length = decodeLength(is);
 if (length > 4) {
  throw new IOException("Length greater than 32bit are not supported "+
             " for integers: "+getPositionMessage(is));
 }
 int b = is.read() & 0xFF;
 if ((b & 0x80) > 0) {
  value = -1; /* integer is negative */
 }
 while (length-- > 0) {
  value = (value << 8) | b;
  if (length > 0) {
   b = is.read();
  }
 }
 return value;
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

public static int decodeInteger(BERInputStream is, MutableByte type)
  throws IOException
{
 int length;
 int value = 0;
 type.setValue((byte)is.read());
 if ((type.value != 0x02) && (type.value != 0x43) &&
   (type.value != 0x41)) {
  throw new IOException("Wrong ASN.1 type. Not an integer: "+type.value+
             getPositionMessage(is));
 }
 length = decodeLength(is);
 if (length > 4) {
  throw new IOException("Length greater than 32bit are not supported "+
             " for integers: "+getPositionMessage(is));
 }
 int b = is.read() & 0xFF;
 if ((b & 0x80) > 0) {
  value = -1; /* integer is negative */
 }
 while (length-- > 0) {
  value = (value << 8) | b;
  if (length > 0) {
   b = is.read();
  }
 }
 return value;
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

public static byte[] decodeString(BERInputStream is, MutableByte type)
  throws IOException
{
 /*
  * ASN.1 octet string ::= primstring | cmpdstring
  * primstring ::= 0x04 asnlength byte {byte}*
  * cmpdstring ::= 0x24 asnlength string {string}*
  * ipaddress  ::= 0x40 4 byte byte byte byte
  */
 // get the type
 type.setValue((byte)is.read());
 if ((type.value != BER.OCTETSTRING) && (type.value != 0x24) &&
   (type.value != BER.IPADDRESS) && (type.value != BER.OPAQUE) &&
   (type.value != BER.BITSTRING) &&
   (type.value != 0x45)) {
  throw new IOException("Wrong ASN.1 type. Not a string: "+type.value+getPositionMessage(is));
 }
 int length = decodeLength(is);
 byte[] value = new byte[length];
 if (length > 0) {
  int read = is.read(value, 0, length);
  if ((read < 0) || (read < length)) {
   throw new IOException("Wrong string length " + read + " < " + length);
  }
 }
 return value;
}
origin: org.snmp4j/snmp4j

public static byte[] decodeString(BERInputStream is, MutableByte type)
  throws IOException
{
 /*
  * ASN.1 octet string ::= primstring | cmpdstring
  * primstring ::= 0x04 asnlength byte {byte}*
  * cmpdstring ::= 0x24 asnlength string {string}*
  * ipaddress  ::= 0x40 4 byte byte byte byte
  */
 // get the type
 type.setValue((byte)is.read());
 if ((type.value != BER.OCTETSTRING) && (type.value != 0x24) &&
   (type.value != BER.IPADDRESS) && (type.value != BER.OPAQUE) &&
   (type.value != BER.BITSTRING) &&
   (type.value != 0x45)) {
  throw new IOException("Wrong ASN.1 type. Not a string: "+type.value+getPositionMessage(is));
 }
 int length = decodeLength(is);
 byte[] value = new byte[length];
 if (length > 0) {
  int read = is.read(value, 0, length);
  if ((read < 0) || (read < length)) {
   throw new IOException("Wrong string length " + read + " < " + length);
  }
 }
 return value;
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

public static void decodeNull(BERInputStream is, MutableByte type)
  throws IOException
{
 // get the type
 type.setValue((byte)(is.read() & 0xFF));
 if ((type.value != (byte)0x05) && (type.value != (byte)0x80) &&
   (type.value != (byte)0x81) && (type.value != (byte)0x82)) {
  throw new IOException("Wrong ASN.1 type. Is not null: " + type.value+
             getPositionMessage(is));
 }
 int length = decodeLength(is);
 if (length != 0) {
  throw new IOException("Invalid Null encoding, length is not zero: "+
             length+getPositionMessage(is));
 }
}
origin: org.snmp4j/snmp4j

public static void decodeNull(BERInputStream is, MutableByte type)
  throws IOException
{
 // get the type
 type.setValue((byte)(is.read() & 0xFF));
 if ((type.value != (byte)0x05) && (type.value != (byte)0x80) &&
   (type.value != (byte)0x81) && (type.value != (byte)0x82)) {
  throw new IOException("Wrong ASN.1 type. Is not null: " + type.value+
             getPositionMessage(is));
 }
 int length = decodeLength(is);
 if (length != 0) {
  throw new IOException("Invalid Null encoding, length is not zero: "+
             length+getPositionMessage(is));
 }
}
origin: org.kaazing/snmp4j

public static final void decodeNull(BERInputStream is, MutableByte type)
  throws IOException
{
 // get the type
 type.setValue((byte)(is.read() & 0xFF));
 if ((type.value != (byte)0x05) && (type.value != (byte)0x80) &&
   (type.value != (byte)0x81) && (type.value != (byte)0x82)) {
  throw new IOException("Wrong ASN.1 type. Is not null: " + type.value+
             getPositionMessage(is));
 }
 int length = decodeLength(is);
 if (length != 0) {
  throw new IOException("Invalid Null encoding, length is not zero: "+
             length+getPositionMessage(is));
 }
}
origin: org.kaazing/snmp4j

public MutableByte(byte value) {
 setValue(value);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

public MutableByte(byte value) {
 setValue(value);
}
origin: org.snmp4j/snmp4j

public MutableByte(byte value) {
 setValue(value);
}
org.snmp4j.asn1BER$MutableBytesetValue

Popular methods of BER$MutableByte

  • <init>
  • getValue

Popular in Java

  • Making http post requests using okhttp
  • notifyDataSetChanged (ArrayAdapter)
  • requestLocationUpdates (LocationManager)
  • getSharedPreferences (Context)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now