Examples of InputStreamWrapper


Examples of org.apache.jackrabbit.test.api.util.InputStreamWrapper

     * by the implementation.
     *
     * @throws RepositoryException
     */
    public void testInputStream() throws RepositoryException {
        InputStreamWrapper in = new InputStreamWrapper(new ByteArrayInputStream(binaryValue));
        valueFactory.createValue(in);
        assertTrue("ValueFactory.createValue(InputStream) is expected to close the passed input stream", in.isClosed());

        in = new InputStreamWrapper(new ByteArrayInputStream(binaryValue));
        Binary bin = valueFactory.createBinary(in);
        assertTrue("ValueFactory.createBinary(InputStream) is expected to close the passed input stream", in.isClosed());
        bin.dispose();
    }
View Full Code Here

Examples of org.hsqldb.lib.InputStreamWrapper

                backup = new DbBackup(archiveFile, dbPath);

                backup.setAbortUponModify(false);

                if (!blocking) {
                    InputStreamWrapper isw;
                    File               file = null;

                    if (hasCache()) {
                        DataFileCache dataFileCache = getCache();
                        RAShadowFile shadowFile =
                            dataFileCache.getShadowFile();

                        if (shadowFile == null) {
                            backup.setFileIgnore(dataFileExtension);
                        } else {
                            file = new File(dataFileCache.dataFileName);
                            isw = new InputStreamWrapper(
                                new FileInputStream(file));

                            isw.setSizeLimit(
                                dataFileCache.fileStartFreePosition);
                            backup.setStream(dataFileExtension, isw);

                            InputStreamInterface isi =
                                shadowFile.getInputStream();

                            backup.setStream(backupFileExtension, isi);
                        }
                    }

                    // log
                    file = new File(log.getLogFileName());

                    long fileLength = file.length();

                    if (fileLength == 0) {
                        backup.setFileIgnore(logFileExtension);
                    } else {
                        isw = new InputStreamWrapper(
                            new FileInputStream(file));

                        isw.setSizeLimit(fileLength);
                        backup.setStream(logFileExtension, isw);
                    }
                }

                if (asFiles) {
View Full Code Here

Examples of org.hsqldb.lib.InputStreamWrapper

            }

            modTime     = file.lastModified() / 1000L;
            fileMode    = TarEntrySupplicant.getLameMode(file);
            dataSize    = file.length();
            inputStream = new InputStreamWrapper(new FileInputStream(file));
        }
View Full Code Here

Examples of org.hsqldb.lib.InputStreamWrapper

             *  This constructor not available until Java 1.6:
             * inputStream = new PipedInputStream(outPipe, maxBytes);
             */
            try {
                inputStream =
                    new InputStreamWrapper(new PipedInputStream(outPipe));

                while ((i =
                        origStream.read(tarStream.writeBuffer, 0,
                                        tarStream.writeBuffer.length)) > 0) {
                    outPipe.write(tarStream.writeBuffer, 0, i);
View Full Code Here

Examples of org.hsqldb.lib.InputStreamWrapper

            File outFile = new File(archiveFile, componentFiles[i].getName());
            fileOut = new FileOutputStream(outFile);

            if (componentStreams[i] == null) {
                componentStreams[i] = new InputStreamWrapper(
                    new FileInputStream(componentFiles[i]));
            }

            InputStreamInterface instream = componentStreams[i];
View Full Code Here

Examples of org.hsqldb.lib.InputStreamWrapper

                backup = new DbBackup(archiveFile, dbPath);

                backup.setAbortUponModify(false);

                if (!blocking) {
                    InputStreamWrapper isw;
                    File               file = null;

                    if (hasCache()) {
                        DataFileCache dataFileCache = getCache();

                        file = new File(dataFileCache.dataFileName);
                        isw = new InputStreamWrapper(
                            new FileInputStream(file));

                        isw.setSizeLimit(dataFileCache.fileStartFreePosition);
                        backup.setStream(dataFileExtension, isw);

                        RAShadowFile shadowFile =
                            dataFileCache.getShadowFile();

                        if (shadowFile != null) {
                            InputStreamInterface isi =
                                shadowFile.getInputStream();

                            backup.setStream(backupFileExtension, isi);
                        }
                    }

                    // log
                    file = new File(log.getLogFileName());
                    isw  = new InputStreamWrapper(new FileInputStream(file));

                    isw.setSizeLimit(file.length());
                    backup.setStream(logFileExtension, isw);
                }

                backup.write();
            }
View Full Code Here

Examples of org.hsqldb.lib.InputStreamWrapper

            }

            modTime     = file.lastModified() / 1000L;
            fileMode    = TarEntrySupplicant.getLameMode(file);
            dataSize    = file.length();
            inputStream = new InputStreamWrapper(new FileInputStream(file));
        }
View Full Code Here

Examples of org.hsqldb.lib.InputStreamWrapper

            /* This constructor not available until Java 1.6:
            inputStream = new PipedInputStream(outPipe, maxBytes);
            */
            try {
                inputStream = new InputStreamWrapper(new PipedInputStream(outPipe));
                while ((i =
                        origStream
                            .read(tarStream.writeBuffer, 0, tarStream
                                .writeBuffer.length)) > 0) {
                    outPipe.write(tarStream.writeBuffer, 0, i);
View Full Code Here

Examples of org.jibx.runtime.impl.InputStreamWrapper

         * @throws IOException on error reading input stream
         */
        public IXMLReader getReader(IInByteBuffer buff, String charcode, String name, boolean reset)
        throws IOException {
            if (m_inWrapper == null) {
                m_inWrapper = new InputStreamWrapper();
            }
            m_inWrapper.reset();
            m_inWrapper.setBuffer(buff);
            m_inWrapper.setEncoding(charcode);
            try {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.