Java ByteBuffer Set setSInt(ByteBuffer buffer, int data)

Here you can find the source of setSInt(ByteBuffer buffer, int data)

Description

set S Int

License

Open Source License

Declaration

public static void setSInt(ByteBuffer buffer, int data) 

Method Source Code

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

import java.nio.ByteBuffer;

public class Main {
    public static void setSInt(ByteBuffer buffer, int data) {

        assert (buffer.capacity() - buffer.position() >= 4);

        buffer.put((byte) (data & 0x000000ffl));
        buffer.put((byte) ((data & 0x0000ff00l) >> 8));
        buffer.put((byte) ((data & 0x00ff0000l) >> 16));
        buffer.put((byte) ((data & 0xff000000l) >> 24));
    }/*from   w ww. j  a va 2  s. co  m*/
}

Related

  1. setCreationTime(ByteBuffer buf, Date date)
  2. setFree(int frameIx, int offset, boolean free, ByteBuffer[] frames)
  3. setLimIfNeeded(ByteBuffer bb, int lim)
  4. setLong(ByteBuffer buffer, long data)
  5. setSByte(ByteBuffer buffer, byte data)
  6. setString(ByteBuffer buffer, int index)
  7. setString(ByteBuffer buffer, String data)
  8. setUniqueness(ByteBuffer bb, long uniqueness)
  9. setUnsignedInt32(ByteBuffer buffer, int offset, long value)