Code example for Semaphore

Methods: acquireUninterruptibly

0
	private Semaphore        done;
	private List<ByteBuffer> buffers;
	private int              bytes;
	 
	public ChannelCallback(){ 
		this.done    = new Semaphore(1);
		this.buffers = new LinkedList<ByteBuffer>();
		this.bytes   = 0;
		 
		this.done.acquireUninterruptibly();
	} 
	 
	public void channelHeader(Channel channel, byte[] header){
		/* Ignore */ 
	} 
	 
	public void channelData(Channel channel, byte[] data){
		ByteBuffer buffer = ByteBuffer.wrap(data);
		 
		this.bytes += data.length;
Contextual code suggestions in your IDE  Get Codota for Java