Java ByteBuffer Get getAddress(ByteBuffer buf)

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

Description

get Address

License

Open Source License

Declaration

public static long getAddress(ByteBuffer buf) 

Method Source Code

//package com.java2s;
/*-------------------------------------------------------------------------------------------------
 _______ __   _ _______ _______ ______  ______
 |_____| | \  |    |    |______ |     \ |_____]
 |     | |  \_|    |    ______| |_____/ |_____]
    /*from  ww w .  j a va2 s  . c  o  m*/
 Copyright (c) 2016, antsdb.com and/or its affiliates. All rights reserved. *-xguo0<@
    
 This program is free software: you can redistribute it and/or modify it under the terms of the
 GNU Affero General Public License, version 3, as published by the Free Software Foundation.
    
 You should have received a copy of the GNU Affero General Public License along with this program.
 If not, see <https://www.gnu.org/licenses/agpl-3.0.txt>
-------------------------------------------------------------------------------------------------*/

import java.lang.reflect.Field;

import java.nio.ByteBuffer;

public class Main {
    private static Field ADDRESS_FIELD;

    public static long getAddress(ByteBuffer buf) {
        try {
            long address;
            address = ADDRESS_FIELD.getLong(buf);
            return address;
        } catch (Exception x) {
            throw new RuntimeException(x);
        }
    }
}

Related

  1. calculateNewLength(ByteBuffer source, ByteBuffer target)
  2. get(ByteBuffer buffer)
  3. get(ByteBuffer source)
  4. get3ByteInt(ByteBuffer buffer)
  5. getActiveArray(ByteBuffer buffer)
  6. getAddress(ByteBuffer buffer)
  7. getAddress(ByteBuffer buffer)
  8. getAddressFromDirectByteBuffer(ByteBuffer buffer)
  9. getArray(ByteBuffer buffer)