Java ByteBuffer to Int Array getIntFromBack(ByteBuffer bb)

Here you can find the source of getIntFromBack(ByteBuffer bb)

Description

get Int From Back

License

Open Source License

Declaration

public static int getIntFromBack(ByteBuffer bb) 

Method Source Code


//package com.java2s;
/* Description and License
 * MCBMini is a complete, open-source, flexible and scalable
 * motor control scheme with board designs, firmware and host
 * software./*w  w w. j av a 2 s  . c o  m*/
 * This is the host software for MCBMini called MCBMiniServer
 * The MCBMini project can be downloaded from:
 * http://code.google.com/p/mcbmini/
 *
 * (c) Sigurdur Orn Adalgeirsson (siggi@alum.mit.edu)
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation;
 * version 2 of the License.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General
 * Public License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
 * Boston, MA  02111-1307  USA
 */

import java.nio.ByteBuffer;

public class Main {
    public static int getIntFromBack(ByteBuffer bb) {
        int val = bb.getInt(bb.limit() - 4);
        bb.limit(bb.limit() - 4);
        return val;
    }
}

Related

  1. getIntArray(ByteBuffer data, int offset, int length)
  2. getIntBE(ByteBuffer b, int start, int end)
  3. getIntBE(final ByteBuffer b, final int start, final int end)
  4. getIntByteBuffer(int id)
  5. getIntegerFromBuffer(ByteBuffer buffer, int offset, int size)
  6. getIntFromByteBuffer(ByteBuffer data)
  7. getIntWithChecksum(ByteBuffer buffer, Adler32 checksum)
  8. readIntArray(ByteBuffer bb)
  9. readIntArray(ByteBuffer buf)