Examples of createInputStream()


Examples of org.apache.hadoop.io.compress.GzipCodec.createInputStream()

        CompressionInputStream inputStream = Mockito
                .mock(CompressionInputStream.class);
        CompressionOutputStream outputStream = Mockito
                .mock(CompressionOutputStream.class);
        Mockito.when(codec.createInputStream(Mockito.any(InputStream.class)))
                .thenReturn(inputStream);

        Mockito.when(codec.createOutputStream(Mockito.any(OutputStream.class)))
                .thenReturn(outputStream);
    }
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.common.PDMetadata.createInputStream()

                if (meta != null)
                {
                    DomXmpParser xmpParser = new DomXmpParser();
                    try
                    {
                        XMPMetadata metadata = xmpParser.parse(meta.createInputStream());

                        DublinCoreSchema dc = metadata.getDublinCoreSchema();
                        if (dc != null)
                        {
                            display("Title:", dc.getTitle());
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.common.PDStream.createInputStream()

        if (fd != null)
        {
            PDStream ff3Stream = fd.getFontFile3();
            if (ff3Stream != null)
            {
                bytes = IOUtils.toByteArray(ff3Stream.createInputStream());
            }
        }

        boolean fontIsDamaged = false;
        CFFType1Font cffEmbedded = null;
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.common.filespecification.PDEmbeddedFile.createInputStream()

            metadata.set(Metadata.RESOURCE_NAME_KEY, ent.getKey());
            metadata.set(Metadata.CONTENT_TYPE, file.getSubtype());
            metadata.set(Metadata.CONTENT_LENGTH, Long.toString(file.getSize()));

            if (embeddedExtractor.shouldParseEmbedded(metadata)) {
                TikaInputStream stream = TikaInputStream.get(file.createInputStream());
                try {
                    embeddedExtractor.parseEmbedded(
                            stream,
                            new EmbeddedContentHandler(handler),
                            metadata, false);
View Full Code Here

Examples of org.apache.sling.replication.packaging.ReplicationPackage.createInputStream()

                authProvider, endpoint, packageBuilder, maxNoOfPackages);
        ResourceResolver resourceResolver = mock(ResourceResolver.class);
        ReplicationPackage replicationPackage = mock(ReplicationPackage.class);
        when(replicationPackage.getInfo()).thenReturn(mock(ReplicationPackageInfo.class));
        InputStream stream = mock(InputStream.class);
        when(replicationPackage.createInputStream()).thenReturn(stream);
        simpleHttpReplicationTransportHandler.deliverPackage(resourceResolver, replicationPackage);
    }

    @Test
    public void testRetrievePackagesRemotelyFailing() throws Exception {
View Full Code Here

Examples of org.apache.sshd.server.SshFile.createInputStream()

                    Handle p = handles.get(handle);
                    if (!(p instanceof FileHandle)) {
                        sendStatus(id, SSH_FX_INVALID_HANDLE, handle);
                    } else {
                        SshFile ssh = ((FileHandle) p).getFile();
                        InputStream is = ssh.createInputStream(offset);
                        try {
                            byte[] b = new byte[Math.max(len, 1024 * 32)];
                            len = is.read(b);
                            if (len >= 0) {
                                Buffer buf = new Buffer(len + 5);
View Full Code Here

Examples of org.apache.xmlgraphics.image.loader.impl.ImageRawCCITTFax.createInputStream()

                        break;
                    default:
                        throw new IllegalStateException(
                                "Invalid compression scheme: " + compression);
                    }
                    InputStream in = ccitt.createInputStream();
                    try {
                        byte[] buf = IOUtils.toByteArray(in);
                        io.setImageData(buf);
                    } finally {
                        IOUtils.closeQuietly(in);
View Full Code Here

Examples of org.apache.xmlgraphics.image.loader.impl.ImageRawEPS.createInputStream()

        Rectangle2D bbox = eps.getBoundingBox();
        if (bbox == null) {
            bbox = new Rectangle2D.Double();
            bbox.setFrame(new Point2D.Double(), info.getSize().getDimensionPt());
        }
        InputStream in = eps.createInputStream();
        try {
            String resourceName = info.getOriginalURI();
            if (resourceName == null) {
                resourceName = "inline image";
            }
View Full Code Here

Examples of org.apache.xmlgraphics.image.loader.impl.ImageRawJPEG.createInputStream()

        }

        boolean included = afpContext.getResourceManager().tryIncludeObject(imageObjectInfo);
        if (!included) {
            log.debug("Embedding undecoded JPEG as IOCA image...");
            InputStream inputStream = jpeg.createInputStream();
            try {
                imageObjectInfo.setData(IOUtils.toByteArray(inputStream));
            } finally {
                IOUtils.closeQuietly(inputStream);
            }
View Full Code Here

Examples of org.apache.xmlgraphics.image.loader.impl.ImageRawPNG.createInputStream()

        assertEquals(numColorComponents, filter.getColors());

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        byte[] data = RawPNGTestUtil.buildGRGBAData(gray, red, green, blue, alpha);
        ByteArrayInputStream bais = new ByteArrayInputStream(data);
        when(irpng.createInputStream()).thenReturn(bais);
        irpnga.outputContents(baos);
        if (alpha > -1) {
            byte[] expected = RawPNGTestUtil.buildGRGBAData(gray, red, green, blue, -1);
            assertArrayEquals(expected, baos.toByteArray());
        } else {
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.