Package org.jaggeryjs.hostobjects.stream

Examples of org.jaggeryjs.hostobjects.stream.StreamHostObject


            } catch (IOException e) {
                log.error(e.getMessage(), e);
                throw new ScriptException(e);
            }
        } else {
            StreamHostObject sho = (StreamHostObject) args[0];
            InputStream is = sho.getStream();
            try {
                byte[] buffer = new byte[1024];
                int length;
                while ((length = is.read(buffer)) != -1) {
                    who.inbound.getWsOutbound().writeBinaryMessage(ByteBuffer.wrap(buffer, 0, length));
View Full Code Here


            return;
        }
        Context cx = RhinoEngine.enterContext(this.contextFactory);
        RhinoEngine.putContextProperty(EngineConstants.JAGGERY_CONTEXT, this.asyncContext);
        ByteArrayInputStream bis = new ByteArrayInputStream(byteBuffer.array());
        StreamHostObject sho = (StreamHostObject) cx.newObject(this, "Stream", new Object[]{bis});
        binaryCallback.call(cx, this, this, new Object[]{sho});
        RhinoEngine.exitContext();
    }
View Full Code Here

            stmt.setDouble(index, (Double) obj);
        }
        //Support for streams in queries
        //Added 25/9/2013
        else if (obj instanceof StreamHostObject) {
            StreamHostObject stream=(StreamHostObject)obj;
            stmt.setBinaryStream(index,stream.getStream());
        }
        else {
            stmt.setString(index, HostObjectUtil.serializeObject(obj));
        }
    }
View Full Code Here

TOP

Related Classes of org.jaggeryjs.hostobjects.stream.StreamHostObject

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.