Java ByteBuffer Get getMedium(ByteBuffer buffer)

Here you can find the source of getMedium(ByteBuffer buffer)

Description

Gets a 24-bit medium integer from the specified ByteBuffer s current position and increases the buffers position by 3.

License

Open Source License

Parameter

Parameter Description
buffer The ByteBuffer to read from.

Return

The read 24-bit medium integer.

Declaration

public static int getMedium(ByteBuffer buffer) 

Method Source Code

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

import java.nio.ByteBuffer;

public class Main {
    /**//from  w ww  .j a  va 2  s. c  o m
     * Gets a 24-bit medium integer from the specified {@link ByteBuffer}s current position and increases the buffers
     * position by 3.
     *
     * @param buffer The {@link ByteBuffer} to read from.
     * @return The read 24-bit medium integer.
     */
    public static int getMedium(ByteBuffer buffer) {
        return (buffer.getShort() & 0xFFFF) << 8 | buffer.get() & 0xFF;
    }
}

Related

  1. getLength(ByteBuffer buffer)
  2. getLengthFromBuffer(ByteBuffer in)
  3. getListFromByteBuffer(ByteBuffer data, List classes)
  4. getLTriad(ByteBuffer bb)
  5. getMean(ByteBuffer simulationResults)
  6. getMediumInt(ByteBuffer buffer)
  7. getModularShort(ByteBuffer bb)
  8. getMultiString(ByteBuffer bb, boolean wideChar)
  9. getNaluStartLength(ByteBuffer buffer)