Here you can find the source of getMedium(ByteBuffer buffer)
Parameter | Description |
---|---|
buffer | The ByteBuffer to read from. |
public static int getMedium(ByteBuffer buffer)
//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; } }