Package org.syrup.helpers

Examples of org.syrup.helpers.DataImpl


        while ((l = i.read(b)) >= 0)
        {
            o.write(b, 0, l);
        }
        return new DataImpl(o.toByteArray());
    }
View Full Code Here


    protected Data readData(ResultSet result, String k) throws Exception
    {
        byte[] d = result.getBytes(k);
        if (d != null)
        {
            return new DataImpl(d);
        }
        return null;
    }
View Full Code Here

                }

                if (error.size() > 0
                    && output.size() == 0)
                {
                    return new ResultImpl(context, consume_command, true, null, new DataImpl(error.toByteArray()));
                }
                else
                {
                    if (error.size() > 0)
                    {
                        return new ResultImpl(context, consume_command, true, new DataImpl(output.toByteArray()), new DataImpl(error.toByteArray()));
                    }
                    else
                    {
                        /*
                         * This indicates stdout without stderr.
                         */
                        if (output.size() > 0)
                        {
                            return new ResultImpl(context, consume_command, true, new DataImpl(output.toByteArray()), null);
                        }
                        else
                        {
                            return new ResultImpl(context, consume_command, true, null, null);
                        }
View Full Code Here

                    String tail = content.substring(i
                        + split.length(), content.length());

                    if (tail.length() > 0)
                    {
                        return new ResultImpl(context, true, true, new DataImpl(head.getBytes()), new DataImpl(tail.getBytes()));
                    }
                    else
                    {
                        // [TODO: optimize by prefabricating the NetworkImpl]
                        NetworkImpl network = new NetworkParser().parse(replaceWorkflow.getBytes());
                        // Returns the Workflow.
                        return new WorkflowImpl(new ResultImpl(context, true, true, new DataImpl(head.getBytes()), null), network);
                    }
                }
                else
                {
                    // [TODO: optimize by prefabricating the NetworkImpl]
View Full Code Here

                    + i2.length];

                System.arraycopy(i1, 0, cc, 0, i1.length);
                System.arraycopy(i2, 0, cc, i1.length, i2.length);

                return new ResultImpl(context, true, true, new DataImpl(cc), null);
            }
            else
            {
                throw new Exception("both inputs need to be full");
            }
View Full Code Here

                    && output.size() == 0)
                {
                    /*
                     * This problably indicates an error.
                     */
                    return new ResultImpl(context, consume_command, true, null, new DataImpl(error.toByteArray()));
                }
                else
                {
                    if (error.size() > 0)
                    {
                        /*
                         * This indicates stdout + stderr Not clear how to
                         * handle this if it does indicate a real problem.
                         */
                        return new ResultImpl(context, consume_command, true, new DataImpl(output.toByteArray()), new DataImpl(error.toByteArray()));
                    }
                    else
                    {
                        /*
                         * This indicates stdout without stderr.
                         */
                        if (output.size() > 0)
                        {
                            return new ResultImpl(context, consume_command, true, new DataImpl(output.toByteArray()), null);
                        }
                        else
                        {
                            return new ResultImpl(context, consume_command, true, null, null);
                        }
View Full Code Here

                if (context.in_1_link().from().task() != null)
                {
                    if (((PTask) context.in_1_link().from().task()).done())
                    {
                        return new ResultImpl(context, true, true, new DataImpl(i1), new DataImpl(i1));
                    }
                    else
                    {
                        return new ResultImpl(context, true, true, new DataImpl(i1), null);
                    }
                }
                else
                {
                    return new ResultImpl(context, true, true, new DataImpl(i1), new DataImpl(i1));
                }
            }
            else
            {
                throw new Exception("first input needs to be full");
View Full Code Here

TOP

Related Classes of org.syrup.helpers.DataImpl

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.