Java ByteBuffer Read readTs(ByteBuffer is, int c)

Here you can find the source of readTs(ByteBuffer is, int c)

Description

read Ts

License

Mozilla Public License

Declaration

public static long readTs(ByteBuffer is, int c) 

Method Source Code

//package com.java2s;
//License from project: Mozilla Public License 

import java.nio.ByteBuffer;

public class Main {
    public static long readTs(ByteBuffer is, int c) {
        return (((long) c & 0x0e) << 29) | ((is.get() & 0xff) << 22)
                | (((is.get() & 0xff) >> 1) << 15)
                | ((is.get() & 0xff) << 7) | ((is.get() & 0xff) >> 1);
    }//from ww  w . j a v a 2  s .c  o m

    public static long readTs(ByteBuffer is) {
        return (((long) is.get() & 0x0e) << 29) | ((is.get() & 0xff) << 22)
                | (((is.get() & 0xff) >> 1) << 15)
                | ((is.get() & 0xff) << 7) | ((is.get() & 0xff) >> 1);
    }
}

Related

  1. readSize(ByteBuffer buf)
  2. readSize(ByteBuffer buffer)
  3. readSmart(ByteBuffer buffer)
  4. readToBytes(ByteBuffer byteBuffer)
  5. readTs(ByteBuffer is)
  6. readUUID(ByteBuffer buffer)
  7. readVariableLength(ByteBuffer buf)
  8. readVInt(ByteBuffer bb)
  9. readVInt(ByteBuffer bb)