Package org.armedbear.lisp
Class TwoWayStream
java.lang.Object
org.armedbear.lisp.LispObject
org.armedbear.lisp.StructureObject
org.armedbear.lisp.Stream
org.armedbear.lisp.TwoWayStream
- Direct Known Subclasses:
SocketStream
-
Nested Class Summary
Nested classes/interfaces inherited from class org.armedbear.lisp.Stream
Stream.EolStyle, Stream.ReadtableAccessor
-
Field Summary
FieldsFields inherited from class org.armedbear.lisp.Stream
AVAILABLE_ENCODINGS, charPos, currentReadtable, elementType, encoding, eolChar, eolStyle, externalFormat, faslReadtable, isBinaryStream, isCharacterStream, isInputStream, isOutputStream, keywordDefault, lastChar, lineNumber, offset, OUT_SYNONYM_OF, platformEolStyle, reader, SET_STREAM_EXTERNAL_FORMAT, STREAM_EXTERNAL_FORMAT
-
Constructor Summary
ConstructorsConstructorDescriptionTwoWayStream
(Stream in, Stream out) TwoWayStream
(Stream in, Stream out, boolean interactive) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Returns a boolean indicating input readily availablevoid
Reads all input from the underlying stream, until _charReady() indicates no more input to be availablevoid
Flushes any buffered output in the (underlying) streamint
Reads an 8-bit byte off the underlying streamprotected int
Reads a character off an underlying streamprotected void
_unreadChar
(int n) Puts a character back into the (underlying) streamvoid
_writeByte
(int n) Writes an 8-bit byte off the underlying streamvoid
_writeChar
(char c) Writes a character into the underlying stream, updating charPos while doing sovoid
_writeChars
(char[] chars, int start, int end) Writes a series of characters in the underlying stream, updating charPos while doing sovoid
_writeLine
(String s) Writes a string to the underlying stream, appending a new line and updating charPos while doing sovoid
Writes a string to the underlying stream, updating charPos while doing soclassOf()
close
(LispObject abort) Emit a newline unless at character position zero Return T if newline was emitted, NIL otherwiseboolean
boolean
boolean
boolean
listen()
typeOf()
typep
(LispObject type) Methods inherited from class org.armedbear.lisp.Stream
_byteReady, _close, _getFilePosition, _setFilePosition, availableEncodings, clearInput, fileLength, fileStringLength, finishOutput, getCharPos, getEncoding, getExternalFormat, getFilePosition, getLineNumber, getOffset, getWrappedInputStream, getWrappedOutputStream, getWrappedReader, getWrappedWriter, initAsBinaryInputStream, initAsBinaryOutputStream, initAsCharacterInputStream, initAsCharacterOutputStream, invert, isInputStream, isInteractive, isOpen, isOutputStream, prin1, print, printStackTrace, read, readArray, readByte, readChar, readChar, readCharacterLiteral, readCharNoHang, readComplex, readDelimitedList, readDispatchChar, readLine, readList, readPathname, readPreservingWhitespace, readRadix, readSharpDot, readSharpLeftParen, readSharpStar, readString, readStructure, readSymbol, readSymbol, setCharPos, setExternalFormat, setFilePosition, setInteractive, setOpen, setWriter, skipBalancedComment, streamNotBinaryOutputStream, streamNotCharacterInputStream, streamNotCharacterOutputStream, streamNotInputStream, streamNotOutputStream, terpri, unreadChar
Methods inherited from class org.armedbear.lisp.StructureObject
equalp, getFixnumSlotValue, getParts, getSlotIndex, getSlotValue, getSlotValue_0, getSlotValue_1, getSlotValue_2, getSlotValue_3, getSlotValueAsBoolean, psxhash, psxhash, setSlotValue, setSlotValue, setSlotValue_0, setSlotValue_1, setSlotValue_2, setSlotValue_3, SLOT_VALUE
Methods inherited from class org.armedbear.lisp.LispObject
ABS, add, add, aref, AREF, AREF, aref_long, aset, aset, aset, ash, ash, atom, ATOM, caddr, cadr, car, cddr, cdr, CHAR, characterp, CHARACTERP, chars, COMPLEXP, constantp, CONSTANTP, copyToArray, decr, DENOMINATOR, dispatch, divideBy, doubleValue, elt, endp, ENDP, EQ, eql, eql, eql, EQL, equal, equal, EQUAL, equalp, evenp, EVENP, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, floatp, FLOATP, floatValue, getBooleanValue, getCallCount, getDescription, getDocumentation, getHotCount, getInstance, getPropertyList, getStringChars, getStringValue, getSymbolFunction, getSymbolFunctionOrDie, getSymbolSetfFunction, getSymbolSetfFunctionOrDie, getSymbolValue, incr, incrementCallCount, incrementHotCount, integerp, INTEGERP, intValue, IS_E, IS_GE, IS_GT, IS_LE, IS_LT, IS_NE, isEqualTo, isEqualTo, isGreaterThan, isGreaterThan, isGreaterThanOrEqualTo, isGreaterThanOrEqualTo, isLessThan, isLessThan, isLessThanOrEqualTo, isLessThanOrEqualTo, isNotEqualTo, isNotEqualTo, isSpecialOperator, isSpecialVariable, javaInstance, javaInstance, LDB, length, LENGTH, listp, LISTP, lockableInstance, LOGAND, LOGAND, LOGIOR, LOGIOR, LOGNOT, LOGXOR, LOGXOR, longValue, minusp, MINUSP, MOD, MOD, multiplyBy, multiplyBy, negate, noFillPointer, NOT, nreverse, NTH, NTH, nthcdr, numberp, NUMBERP, NUMERATOR, oddp, ODDP, plusp, PLUSP, princToString, push, rationalp, RATIONALP, realp, REALP, resolve, reverse, RPLACA, RPLACD, SCHAR, setCallCount, setCar, setCdr, setDocumentation, setHotCount, setPropertyList, SIMPLE_STRING_P, STRING, stringp, STRINGP, subtract, subtract, SVREF, svset, sxhash, SYMBOLP, truncate, unreadableString, unreadableString, VECTOR_PUSH_EXTEND, VECTOR_PUSH_EXTEND, vectorp, VECTORP, vectorPushExtend, zerop, ZEROP
-
Field Details
-
in
-
out
-
-
Constructor Details
-
TwoWayStream
-
TwoWayStream
-
-
Method Details
-
getElementType
- Overrides:
getElementType
in classStream
-
getInputStream
-
getOutputStream
-
isCharacterInputStream
public boolean isCharacterInputStream()- Overrides:
isCharacterInputStream
in classStream
-
isBinaryInputStream
public boolean isBinaryInputStream()- Overrides:
isBinaryInputStream
in classStream
-
isCharacterOutputStream
public boolean isCharacterOutputStream()- Overrides:
isCharacterOutputStream
in classStream
-
isBinaryOutputStream
public boolean isBinaryOutputStream()- Overrides:
isBinaryOutputStream
in classStream
-
typeOf
-
classOf
-
typep
-
_readChar
Description copied from class:Stream
Reads a character off an underlying stream- Overrides:
_readChar
in classStream
- Returns:
- a character, or -1 at end-of-file
- Throws:
IOException
-
_unreadChar
Description copied from class:Stream
Puts a character back into the (underlying) stream- Overrides:
_unreadChar
in classStream
- Parameters:
n
-- Throws:
IOException
-
_charReady
Description copied from class:Stream
Returns a boolean indicating input readily available- Overrides:
_charReady
in classStream
- Returns:
- true if a character is available
- Throws:
IOException
-
_writeChar
public void _writeChar(char c) Description copied from class:Stream
Writes a character into the underlying stream, updating charPos while doing so- Overrides:
_writeChar
in classStream
- Parameters:
c
-
-
_writeChars
public void _writeChars(char[] chars, int start, int end) Description copied from class:Stream
Writes a series of characters in the underlying stream, updating charPos while doing so- Overrides:
_writeChars
in classStream
- Parameters:
chars
-start
-end
-
-
_writeString
Description copied from class:Stream
Writes a string to the underlying stream, updating charPos while doing so- Overrides:
_writeString
in classStream
- Parameters:
s
-
-
_writeLine
Description copied from class:Stream
Writes a string to the underlying stream, appending a new line and updating charPos while doing so- Overrides:
_writeLine
in classStream
- Parameters:
s
-
-
_readByte
public int _readByte()Description copied from class:Stream
Reads an 8-bit byte off the underlying stream -
_writeByte
public void _writeByte(int n) Description copied from class:Stream
Writes an 8-bit byte off the underlying stream- Overrides:
_writeByte
in classStream
- Parameters:
n
-
-
_finishOutput
public void _finishOutput()Description copied from class:Stream
Flushes any buffered output in the (underlying) stream- Overrides:
_finishOutput
in classStream
-
_clearInput
public void _clearInput()Description copied from class:Stream
Reads all input from the underlying stream, until _charReady() indicates no more input to be available- Overrides:
_clearInput
in classStream
-
listen
-
freshLine
Description copied from class:Stream
Emit a newline unless at character position zero Return T if newline was emitted, NIL otherwise -
close
-
printObject
- Overrides:
printObject
in classStructureObject
-