@@ -0,0 +1,1874 @@
+/*%0A * Copyright 2016 Bahman Movaqar%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.ojlang.runtime.sysio.impls;%0A%0Aimport org.ojlang.exceptions.SysIoException;%0Aimport org.ojlang.runtime.sysio.StdOut;%0A%0Aimport java.io.Serializable;%0Aimport java.util.concurrent.ArrayBlockingQueue;%0Aimport java.util.concurrent.BlockingQueue;%0A%0A/**%0A * A blocking STDIN based on a blocking queue.%0A *%0A * @author Bahman Movaqar %5BBahman AT BahmanM.com%5D%0A */%0Apublic class BlockingStdOut implements StdOut, Serializable %7B%0A%0A  final static private long serialVersionUID = 5670378131482996110L;%0A  final static private int DEFAULT_CAPACITY = 1000;%0A%0A  final private BlockingQueue%3CString%3E data;%0A%0A  /**%0A   * Creates a new instance with a given capacity.%0A   *%0A   * @param capacity the given capacity%0A   */%0A  public BlockingStdOut(int capacity) %7B%0A    data = new ArrayBlockingQueue%3C%3E(capacity);%0A  %7D%0A%0A  /**%0A   * Creates a new instance with the default capacity (i.e. 1000).%0A   */%0A  public BlockingStdOut() %7B%0A    data = new ArrayBlockingQueue%3C%3E(DEFAULT_CAPACITY);%0A  %7D%0A%0A  @Override%0A  public String get() %7B%0A    try %7B%0A      return data.take();%0A    %7D catch (InterruptedException e) %7B%0A      throw new SysIoException(e);%0A    %7D%0A  %7D%0A%0A  @Override%0A  public void put(String chunk) %7B%0A    try %7B%0A      data.put(chunk);%0A    %7D catch (InterruptedException e) %7B%0A      throw new SysIoException(e);%0A    %7D%0A  %7D%0A%0A%7D%0A

add blocking StdOut implementation