Java ByteBuffer Put putTriByte(ByteBuffer buf, int value)

Here you can find the source of putTriByte(ByteBuffer buf, int value)

Description

Writes a 'tri-byte' to the specified buffer.

License

Open Source License

Parameter

Parameter Description
buf The buffer.
value The value.

Declaration

public static void putTriByte(ByteBuffer buf, int value) 

Method Source Code

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

import java.nio.ByteBuffer;

public class Main {
    /**//from   w ww.j a v a2  s  . c om
     * Writes a 'tri-byte' to the specified buffer.
     * @param buf The buffer.
     * @param value The value.
     */
    public static void putTriByte(ByteBuffer buf, int value) {
        buf.put((byte) (value >> 16));
        buf.put((byte) (value >> 8));
        buf.put((byte) value);
    }
}

Related

  1. putString(final ByteBuffer buffer, final String string)
  2. putString(String name, ByteBuffer buffer)
  3. putString(String str, ByteBuffer bb)
  4. putStringAsCharArray(ByteBuffer byteBuffer, String s)
  5. putStringToByteBuffer(final ByteBuffer bb, String value, String charset)
  6. putTruncatedInt(ByteBuffer bytes, int value, int numBytes)
  7. putUInt16(ByteBuffer buffer, long value)
  8. putUInt32(ByteBuffer buffer, long value)
  9. putUnsignedByte(ByteBuffer bb, int value)