Java ByteBuffer Put putByte(ByteBuffer byteBuffer, int value)

Here you can find the source of putByte(ByteBuffer byteBuffer, int value)

Description

put Byte

License

Apache License

Declaration

public static void putByte(ByteBuffer byteBuffer, int value) 

Method Source Code


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

import java.nio.ByteBuffer;

public class Main {
    private static final int BYTE_PADDING = 0xFF;

    public static void putByte(ByteBuffer byteBuffer, int value) {
        byteBuffer.put((byte) (value & BYTE_PADDING));
    }// w ww  .  j  a va 2 s.c o  m

    public static void putByte(ByteBuffer byteBuffer, int position, int value) {
        byteBuffer.put(position, (byte) (value & BYTE_PADDING));
    }
}

Related

  1. put(ByteBuffer src, ByteBuffer dst)
  2. put3ByteInt(ByteBuffer buffer, int val)
  3. putAscii(ByteBuffer bytes, String value)
  4. putAsMuchAsPossible(ByteBuffer dest, ByteBuffer src)
  5. putBoolean(ByteBuffer bb, boolean value)
  6. putByteArray(ByteBuffer byteBuffer, byte[] array)
  7. putByteAsString(ByteBuffer buffer, byte value)
  8. putByteBuffer(ByteBuffer source, ByteBuffer target)
  9. putBytesUnescaped(ByteBuffer buffer, byte[] data)