Java ByteBuffer Put readBER32(ByteBuffer input)

Here you can find the source of readBER32(ByteBuffer input)

Description

read BER

License

Open Source License

Declaration

public static int readBER32(ByteBuffer input) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.nio.ByteBuffer;

public class Main {
    public static int readBER32(ByteBuffer input) {
        int size = 0;
        for (int i = 0; i < 4; i++) {
            byte b = input.get();
            size = (size << 7) | (b & 0x7f);
            if (((b & 0xff) >> 7) == 0)
                break;
        }//from   w  w  w . j  a v a  2  s  . c o  m
        return size;
    }
}

Related

  1. putVInt(ByteBuffer b, int i)
  2. putWhatFits(ByteBuffer dest, ByteBuffer src)
  3. putWithChecksum(ByteBuffer buffer, int value, Adler32 checksum)
  4. read(InputStream is, ByteBuffer buf, int bytes)
  5. readAsByteBuffer(final InputStream source)
  6. readByteBuffer(DataInputStream is)
  7. readByteBufferList(DataInputStream is)
  8. readBytes(InputStream is, ByteBuffer buffer)
  9. readByteVector8(ByteBuffer input)