Package java.io

Examples of java.io.DataInputStream


    this.client = client;
    if (this.client != null)
      try {
        client.setSoTimeout(10 * 60000);// 10����û����Ӧ����Ϊ��ʱ
        out = new DataOutputStream(new BufferedOutputStream(client.getOutputStream()));
        in = new DataInputStream(new BufferedInputStream(client.getInputStream()));
      } catch (IOException e) {
        logger.error(e);
        close();
      }
  }
View Full Code Here


            return;
        }

        // FtpClient client = fileSystem.getClient();
        mis = fileObject.getInputStream(filePointer);
        dis = new DataInputStream(new FilterInputStream(mis)
        {
            public int read() throws IOException
            {
                int ret = super.read();
                if (ret > -1)
View Full Code Here

        if (dis != null)
        {
            mis.abort();

            // this is to avoid recursive close
            DataInputStream oldDis = dis;
            dis = null;
            oldDis.close();
            mis = null;
        }
    }
View Full Code Here

                    "vfs.provider.http/get-range.error", new Object[]{
                    fileObject.getName(), new Long(filePointer)});
            }

            mis = data;
            dis = new DataInputStream(new FilterInputStream(mis)
            {
                public int read() throws IOException
                {
                    int ret = super.read();
                    if (ret > -1)
View Full Code Here

   public synchronized void reset() throws JMSException {
      if (this.writeOnly) {
         this.content = this.baos.toByteArray();
      }
      this.bais = new ByteArrayInputStream(this.content);
      this.dataIs = new DataInputStream(this.bais);
      if (!this.dataIs.markSupported())
         throw new XBException(ErrorCode.INTERNAL_NOTIMPLEMENTED.getDescription(), "Mark is not supported for the stream. Can not recover in case of an IOException");
     
      this.readOnly = true;
      this.writeOnly = false;
View Full Code Here

     *
     * @param url of remote data
     * @exception IOException if there was a problem reading the file.
     */
    public BeLeDataInputStream(URL url) throws IOException {
        this(new BufferedInputStream(new DataInputStream(url.openStream())));
    }
View Full Code Here

                src[3] = bytes[offset + 0];
                offset = 0;
            } else {
                src = bytes;
            }
            DataInputStream stream =
                  new DataInputStream(new ByteArrayInputStream(src, offset, 4));
            return stream.readFloat();
        } catch (Exception ex) {
            throw new DescriptorException(ex);
        }
    }
View Full Code Here

                src[7] = bytes[offset + 0];
                offset = 0;
            } else {
                src = bytes;
            }
            DataInputStream stream =
                  new DataInputStream(new ByteArrayInputStream(src, offset, 8));
            return stream.readDouble();
        } catch (Exception ex) {
            throw new DescriptorException(ex);
        }
    }
View Full Code Here

    public void run() {

      try {

        StringBuffer tmp = new StringBuffer(200) ;
        DataInputStream r = new DataInputStream(input) ;
        while (! parent.finished) {

          sleep(10);
          while (r.available() > 0) {

            int b = r.readUnsignedByte() ;
            if (b != '\r') {

              if (b == '\n') {

                println(tmp.toString()) ;
View Full Code Here

   * @return
   */
  public DataInputStream getInputStream() {
    if(dis == null) {
      ByteArrayInputStream bis = new ByteArrayInputStream(body);
      dis = new DataInputStream(bis);
    }
   
    return dis;
  }
View Full Code Here

TOP

Related Classes of java.io.DataInputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.