Code example for BlockingQueue

Methods: take

0
        } 
    } 
 
    public DCEntry take() { 
        try { 
            return this.surrogates.take();
        } catch (InterruptedException e) {
            Log.logException(e);
            return null; 
        } 
    } 
     
    public static void main(String[] args) {
        File f = new File(args[0]);
        SurrogateReader sr;
        try { 
            InputStream is = new BufferedInputStream(new FileInputStream(f));
            if (f.getName().endsWith(".gz")) is = new GZIPInputStream(is);
            sr = new SurrogateReader(is, 1);
 
            Thread t = new Thread(sr, "Surrogate-Reader " + f.getAbsolutePath());