Package java.io

Examples of java.io.FilterInputStream


   * that does nothing when closed.
   */
  public static InputStream uncloseableInputStream(final InputStream stream)
    throws IOException
  {
      return new FilterInputStream(stream) {

                @Override
                public void close() throws IOException {
                }
             
View Full Code Here


    public InputStream getInputStream()
        throws java.io.IOException
    {    
        checkConnection();
        if (!_urlString.endsWith("!/"))
            return new FilterInputStream(super.getInputStream())
            {
                public void close() throws IOException {this.in=IO.getClosedStream();}
            };

        URL url = new URL(_urlString.substring(4,_urlString.length()-2));     
View Full Code Here

    public InputStream getInputStream( TarEntry entry )
        throws IOException
    {
        if ( entry.equals( (Object) currentEntry &&  inputStream != null )
        {
            return new FilterInputStream( inputStream )
            {
                public void close()
                    throws IOException
                {
                    // Does nothing.
View Full Code Here

        for (Iterator iter = libs.iterator(); iter.hasNext();) {
            String path = (String) iter.next();
            if(path.endsWith(".jar") || path.endsWith(".zip")) {
                ZipInputStream zin = new ZipInputStream(ctx.getResourceAsStream(path));
                // Make stream uncloseable by XML parsers
                InputStream uin = new FilterInputStream(zin) {
                    public void close() {
                    }
                };
                try {
                    for(;;) {
View Full Code Here

      new String(rbuf, 0, r);
      assertEquals("Failed to read entry", 12, r);
  }

    public void testReadOneByteAtATime() throws IOException {
        InputStream in = new FilterInputStream(Support_Resources.getStream("hyts_ZipFile.zip")) {
            @Override
            public int read(byte[] buffer, int offset, int count) throws IOException {
                return super.read(buffer, offset, 1); // one byte at a time
            }
View Full Code Here

        }
      }
      socket.setSoTimeout(timeout);
      this.in = new DataInputStream
        (new BufferedInputStream
         (new FilterInputStream(socket.getInputStream()) {
             public int read(byte[] buf, int off, int len) throws IOException {
               int value = super.read(buf, off, len);
               if (readingCall != null) {
                 readingCall.touch();
               }
View Full Code Here

     * Tests, whether an IOException is properly delegated.
     */
    public void testIOException()
            throws IOException {
        byte[] request = newRequest();
        InputStream stream = new FilterInputStream(new ByteArrayInputStream(request)){
            private int num;
            @Override
            public int read() throws IOException {
                if (++num > 123) {
                    throw new IOException("123");
View Full Code Here

            return dis;
        }

        // 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

                new Long(filePointer)
            });
        }

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

            return dis;
        }

        // 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

TOP

Related Classes of java.io.FilterInputStream

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.