Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/flexstor/common/io/xfile/ftp/FtpInputStream.java


1   /*
2    * FtpInputStream.java
3    *
4    * Copyright $Date: 2003/08/11 02:22:47 $ FLEXSTOR.net Inc.
5    *
6    * This work is licensed for use and distribution under license terms found at
7    * http://www.flexstor.org/license.html
8    *
9    */
10  
11  package com.flexstor.common.io.xfile.ftp;
12  
13  import java.io.BufferedInputStream;
14  import java.io.IOException;
15  import java.io.InputStream;
16  
17  public class FtpInputStream extends BufferedInputStream 
18  {
19      
20    private FtpSession m_client;
21    
22  
23    public FtpInputStream(InputStream in, FtpSession client)
24      throws IOException
25    {
26      super(in,32*1024);
27      m_client = client;
28      
29      while(in.available()<0)
30      {
31          try
32          {
33              Thread.sleep(10L);
34          }catch(Exception ex)
35          {
36              
37          }
38      }
39  
40    }
41  
42    public void close() throws IOException
43      {
44        super.close();
45        m_client.closeTransferSocket();
46      }
47  }