Java ByteBuffer Get getSmart(ByteBuffer buf)

Here you can find the source of getSmart(ByteBuffer buf)

Description

get Smart

License

Open Source License

Declaration

public static int getSmart(ByteBuffer buf) 

Method Source Code

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

import java.nio.ByteBuffer;

public class Main {
    public static int getSmart(ByteBuffer buf) {
        int peek = buf.get(buf.position()) & 0xFF;
        if (peek < 128) {
            return buf.get() & 0xFF;
        } else {/*from ww w.  j  a v a 2s. c  om*/
            return (buf.getShort() & 0xFFFF) - 32768;
        }
    }
}

Related

  1. getSequenceNumber(ByteBuffer chunk)
  2. getShiftedI32(final int bytesPerPixel, final ByteBuffer data, final boolean retainDataPos)
  3. getSize(int size, ByteBuffer buffer)
  4. getSizePrefix(ByteBuffer bb)
  5. getSmallSmartInt(ByteBuffer buffer)
  6. getSmartOld(ByteBuffer in)
  7. getSurrogateKey(byte[] data, ByteBuffer buffer)
  8. getTableUuid(ByteBuffer rowKey)
  9. getTempByteBuffer()