Package java.io

Examples of java.io.FilterInputStream


                InputStream in = rs.getBinaryStream(1);
                /**
                 * return an InputStream wrapper in order to
                 * close the ResultSet when the stream is closed
                 */
                return new FilterInputStream(in) {
                    public void close() throws IOException {
                        super.close();
                        // close ResultSet
                        closeResultSet(rs);
                    }
View Full Code Here


                }

                 // return an InputStream wrapper in order to close the ResultSet when the stream is closed
                close = false;
                final ResultSet rs2 = rs;
                return new FilterInputStream(in) {

                    public void close() throws IOException {
                        try {
                            in.close();
                        } finally {
View Full Code Here

     */
    public InputStream readFile(Node node) throws RepositoryException {
        if (node.hasProperty(Property.JCR_DATA)) {
            Property data = node.getProperty(Property.JCR_DATA);
            final Binary binary = data.getBinary();
            return new FilterInputStream(binary.getStream()) {
                @Override
                public void close() throws IOException {
                    super.close();
                    binary.dispose();
                }
View Full Code Here

                    /**
                     * return an InputStream wrapper in order to
                     * close the ResultSet when the stream is closed
                     */
                    return new FilterInputStream(in) {
                        public void close() throws IOException {
                            in.close();
                            // now it's safe to close ResultSet
                            closeResultSet(rs);
                        }
View Full Code Here

            // create an InputStream that keeps a hard reference to the temp file
            // in order to prevent its automatic deletion once the associated
            // File object is reclaimed by the garbage collector;
            // pass InputStream wrapper to BinaryValue constructor
            return new BinaryValue(new FilterInputStream(new FileInputStream(tmpFile)) {

                File f = tmpFile;

                public void close() throws IOException {
                    in.close();
View Full Code Here

                            }

                            public void onProcess(String name, InputStream in) throws IOException {
                                // This is required so that the underlying ear
                                // is not closed
                                in = new FilterInputStream(in) {
                                    public void close() throws IOException {};
                                };
                                try {
                                    JarFileScanner.scan(in, path, sl);
                                } catch (IOException ex) {
View Full Code Here

      @Override
      public InputStream openStream() throws IOException {
        if (counter[0]++ != 0) {
          throw new IllegalStateException("More than one source open");
        }
        return new FilterInputStream(source.openStream()) {
          @Override public void close() throws IOException {
            super.close();
            counter[0]--;
          }
        };
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

                                new JarFileScanner(new URL(warParent.replace("vfszip", "file")).openStream(), "", true);

                        while (jarFileScanner.hasNext()) {
                            if (jarFileScanner.next().equals(warName)) {

                                resourceFinderStack.push(new JarFileScanner(new FilterInputStream(jarFileScanner.open()) {
                                    // This is required so that the underlying ear
                                    // is not closed

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

            /**
             * return an InputStream wrapper in order to
             * close the ResultSet when the stream is closed
             */
            return new FilterInputStream(in) {
                public void close() throws IOException {
                    in.close();
                    // now it's safe to close ResultSet
                    closeResultSet(rs);
                }
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.