view src/main/java/jp/ac/u_ryukyu/treevnc/SoundPacketQueue.java @ 490:141f627665ab

fix display
author oshiro
date Wed, 30 Jan 2019 20:49:39 +0900
parents 3ede63861103
children
line wrap: on
line source

package jp.ac.u_ryukyu.treevnc;

import com.glavsoft.rfb.encoding.decoder.ByteBuffer;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.TimeUnit;

/**
 * Created by OcBookPro on 15/01/15.
 */
public class SoundPacketQueue {

    private final BlockingQueue<byte[]> queue;

    public SoundPacketQueue(BlockingQueue<byte[]> queue) {
        this.queue = queue;
    }

    public void put(byte[] packet) {
        queue.offer(packet);
    }

    public byte[] get() throws InterruptedException {
        return queue.poll(1, TimeUnit.SECONDS);
    }
}