2009-10-27から1日間の記事一覧

非同期でデータをやりとりする用の有限キューを作ってみた

public final class FiniteBufferQueue { int first; int size; final byte[][] bufs; public FiniteBufferQueue(int size) { bufs = new byte[size][]; } public synchronized void push(byte[] buf) throws InterruptedException { push(buf, 0, buf.lengt…