Java ByteBuffer Write writetUnsignedInt(ByteBuffer buffer, long value)

Here you can find the source of writetUnsignedInt(ByteBuffer buffer, long value)

Description

Write the given long value as a 4 byte unsigned integer.

License

Apache License

Parameter

Parameter Description
buffer The buffer to write to
value The value to write

Declaration

public static void writetUnsignedInt(ByteBuffer buffer, long value) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.nio.ByteBuffer;

public class Main {
    /**/*w w  w.j av a2  s  .  c  o  m*/
     * Write the given long value as a 4 byte unsigned integer. Overflow is ignored.
     *
     * @param buffer The buffer to write to
     * @param value  The value to write
     */
    public static void writetUnsignedInt(ByteBuffer buffer, long value) {
        buffer.putInt((int) (value & 0xffffffffL));
    }
}

Related

  1. writeToChannel(final WritableByteChannel destChannel, final ByteBuffer buffer)
  2. writeToChannel(WritableByteChannel chan, ByteBuffer buffer)
  3. writeToChannel(WritableByteChannel dst, ByteBuffer src)
  4. writeToFile(String name, ByteBuffer bb)
  5. writeTs(ByteBuffer is, long ts)
  6. writeUB2(ByteBuffer buffer, int i)
  7. writeUnsigned(int num, int size, ByteBuffer out)
  8. writeUnsignedInt(ByteBuffer buf, long value)
  9. writeUnsignedInt(final ByteBuffer buffer, final long value)