public class Stream
extends org.mozilla.javascript.ScriptableObject
implements org.mozilla.javascript.Wrapper
A CommonJS-compliant wrapper around a Java input or output stream. To
register Stream as a host object in Rhino call the defineClass() function
with this class.
defineClass(org.ringojs.wrappers.Stream);
To create an Stream wrapper around an instance of java.io.InputStream
or java.io.OutputStream call the constructor with the stream as argument:
var io = new Stream(javaInputStream);
When passed to a Java method that expects an input or output stream, Stream wrappers
are automatically unwrapped. use the unwrap() method to explicitly get the
wrapped stream.
| Constructor and Description |
|---|
Stream() |
Stream(org.mozilla.javascript.Scriptable scope,
Object arg1,
Object arg2) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
closed() |
void |
flush() |
String |
getClassName()
Return the name of the class.
|
Object |
getInputStream() |
Object |
getOutputStream() |
void |
init(Object arg1,
Object arg2) |
Object |
jsunwrap() |
Object |
read(Object limit) |
boolean |
readable() |
int |
readInto(Binary bytes,
Object start,
Object end) |
boolean |
seekable() |
int |
skip(int num) |
Object |
unwrap()
Unwrap the object by returning the wrapped value.
|
boolean |
writable() |
void |
write(Object arg,
Object start,
Object end) |
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, equivalentValues, get, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasInstance, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, size@JSFunction public boolean readable()
@JSFunction public boolean writable()
@JSFunction public boolean seekable()
@JSFunction public void flush()
@JSFunction public int skip(int num)
@JSFunction public void close()
@JSFunction public boolean closed()
@JSFunction(value="unwrap") public Object jsunwrap()
@JSGetter public Object getInputStream()
@JSGetter public Object getOutputStream()
public Object unwrap()
unwrap in interface org.mozilla.javascript.Wrapperpublic String getClassName()
getClassName in interface org.mozilla.javascript.ScriptablegetClassName in class org.mozilla.javascript.ScriptableObjectCopyright © 2016. All rights reserved.