Examples of FastByteArrayInputStream


Examples of xbird.util.io.FastByteArrayInputStream

    public static <T> T readObjectQuietly(final byte[] obj, final ClassLoader cl) {
        return ObjectUtils.<T> readObjectQuietly(new FastByteArrayInputStream(obj), cl);
    }

    public static <T> T readGzipCompressedObjectQuietly(final byte[] obj) {
        final FastByteArrayInputStream bis = new FastByteArrayInputStream(obj);
        final GZIPInputStream gis;
        try {
            gis = new GZIPInputStream(bis);
        } catch (IOException e) {
            throw new IllegalStateException(e);
View Full Code Here

Examples of xbird.util.io.FastByteArrayInputStream

        }
        return ObjectUtils.<T> readObjectQuietly(gis);
    }

    public static <T> T readObject(final byte[] obj) throws IOException, ClassNotFoundException {
        return ObjectUtils.<T> readObject(new FastByteArrayInputStream(obj));
    }
View Full Code Here

Examples of xbird.util.io.FastByteArrayInputStream

        return ObjectUtils.<T> readObject(new FastByteArrayInputStream(obj));
    }

    public static <T> T readGzipCompressedObject(final byte[] obj) throws IOException,
            ClassNotFoundException {
        FastByteArrayInputStream bis = new FastByteArrayInputStream(obj);
        GZIPInputStream gis = new GZIPInputStream(bis);
        return ObjectUtils.<T> readObject(gis);
    }
View Full Code Here

Examples of xbird.util.io.FastByteArrayInputStream

        return ObjectUtils.<T> readObject(gis);
    }

    public static <T> T readObject(final byte[] obj, final ClassLoader cl) throws IOException,
            ClassNotFoundException {
        return ObjectUtils.<T> readObject(new FastByteArrayInputStream(obj), cl);
    }
View Full Code Here

Examples of xbird.util.io.FastByteArrayInputStream

                out.writeChar(c);
            }
        }

        public static CompressedSegment readFrom(final byte[] in) throws IOException {
            FastByteArrayInputStream bis = new FastByteArrayInputStream(in);
            DataInput dis = new DataInputStream(bis);
            int totalEntries = dis.readInt();
            int bitwidth = dis.readByte();
            int firstException = dis.readInt();
            int len = dis.readInt();
            byte[] b = new byte[len];
            dis.readFully(b, 0, len);
            FastByteArrayInputStream codesIs = new FastByteArrayInputStream(b);
            BitInputStream codesBis = new BitInputStream(codesIs);
            int[] codes = new int[totalEntries];
            unpack(codesBis, bitwidth, codes, totalEntries);
            int exceptions = dis.readShort();
            CharArrayList exceptionList = new CharArrayList(exceptions);
View Full Code Here

Examples of xbird.util.io.FastByteArrayInputStream

        }
        return bos.toByteArray();
    }

    public static MultiValue readFrom(byte[] b) throws IOException {
        final FastByteArrayInputStream bis = new FastByteArrayInputStream(b);
        final int size = IOUtils.readInt(bis);
        final Value[] valueAry = new Value[size];
        for(int i = 0; i < size; i++) {
            int len = IOUtils.readInt(bis);
            byte[] v = new byte[len];
            bis.read(v, 0, len);
            valueAry[i] = new Value(v, 0, len);
        }
        return new MultiValue(b, valueAry);
    }
View Full Code Here

Examples of xbird.util.io.FastByteArrayInputStream

        try {
            fetchedData = _proxy.fetchBytes(_fetchSize, compressed);
        } catch (RemoteException e) {
            throw new XQRemoteException(e);
        }
        final FastByteArrayInputStream fis = new FastByteArrayInputStream(fetchedData);
        final InputStream is;
        try {
            is = compressed ? new LZFInputStream(fis) : fis;
        } catch (IOException e) {
            throw new IllegalStateException(e);
View Full Code Here

Examples of xbird.util.io.FastByteArrayInputStream

        IOUtils.writeString("5", def3);
        IOUtils.writeString("6", def3);
        def3.close();

        byte[] b = out.toByteArray();
        FastByteArrayInputStream in = new FastByteArrayInputStream(b);
        ContinousInflaterInputStream inf1 = new ContinousInflaterInputStream(in, new Inflater(false), 8192);
        Assert.assertEquals("1", IOUtils.readString(inf1));
        Assert.assertEquals(2, IOUtils.readInt(inf1));
        Assert.assertEquals("3", IOUtils.readString(inf1));
        Assert.assertEquals("4", IOUtils.readString(inf1));
View Full Code Here

Examples of xbird.util.io.FastByteArrayInputStream

        IOUtils.writeString("5", def1);
        IOUtils.writeString("6", def1);
        def1.close();

        byte[] b = out.toByteArray();
        FastByteArrayInputStream in = new FastByteArrayInputStream(b);
        InflaterInputStream inf1 = new InflaterInputStream(in, new Inflater(false), 8192);
        Assert.assertEquals("1", IOUtils.readString(inf1));
        Assert.assertEquals(2, IOUtils.readInt(inf1));
        Assert.assertEquals("3", IOUtils.readString(inf1));
        Assert.assertEquals("4", IOUtils.readString(inf1));
View Full Code Here

Examples of xbird.util.io.FastByteArrayInputStream

        final byte[] buf = new byte[inputLen];
        input.readFully(buf);
        if(LOG.isDebugEnabled()) {
            LOG.debug("decoding sequence size: " + inputLen);
        }
        FastByteArrayInputStream inputBuf = new FastByteArrayInputStream(buf);
        ObjectInputStream objInput = new ObjectInputStream(inputBuf);
        XQEventDecoder decoder = new XQEventDecoder(objInput);
        return decoder;
    }
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.