Here you can find the source of putUnsignedInt(final ByteBuffer dst, final long value)
Parameter | Description |
---|---|
dst | the ByteBuffer to store the int |
value | the long which contains the unsigned int to store |
public static final void putUnsignedInt(final ByteBuffer dst, final long value)
//package com.java2s; /*/*from ww w .ja v a2 s . co m*/ * #%L * Project eguan * %% * Copyright (C) 2012 - 2015 Oodrive * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * #L% */ import java.nio.ByteBuffer; public class Main { private static final long INT_FLAG_MASK_LONG = 0x00000000FFFFFFFFL; /** * Put an unsigned int in the {@link ByteBuffer} at the current position. * * @param dst * the {@link ByteBuffer} to store the int * @param value * the long which contains the unsigned int to store */ public static final void putUnsignedInt(final ByteBuffer dst, final long value) { dst.putInt((int) (value & INT_FLAG_MASK_LONG)); } }