Class Stream

    • Field Detail

      • isInputStream

        protected boolean isInputStream
      • isOutputStream

        protected boolean isOutputStream
      • isCharacterStream

        protected boolean isCharacterStream
      • isBinaryStream

        protected boolean isBinaryStream
      • reader

        protected java.io.PushbackReader reader
      • offset

        protected int offset
      • lineNumber

        protected int lineNumber
      • charPos

        protected int charPos
        The number of characters on the current line of output Used to determine whether additional line feeds are required when calling FRESH-LINE
      • keywordDefault

        protected static final Symbol keywordDefault
      • eolChar

        protected char eolChar
      • externalFormat

        protected LispObject externalFormat
      • encoding

        protected java.lang.String encoding
      • lastChar

        protected char lastChar
      • STREAM_EXTERNAL_FORMAT

        public static final Primitive STREAM_EXTERNAL_FORMAT
      • SET_STREAM_EXTERNAL_FORMAT

        public static final Primitive SET_STREAM_EXTERNAL_FORMAT
      • AVAILABLE_ENCODINGS

        public static final Primitive AVAILABLE_ENCODINGS
      • currentReadtable

        public static Stream.ReadtableAccessor currentReadtable
        pre-instantiated readtable accessor for the *readtable*.
      • faslReadtable

        public static Stream.ReadtableAccessor faslReadtable
        pre-instantiated readtable accessor for the fasl readtable.
      • OUT_SYNONYM_OF

        public static final Primitive OUT_SYNONYM_OF
    • Constructor Detail

      • Stream

        protected Stream​(Symbol structureClass)
      • Stream

        public Stream​(Symbol structureClass,
                      java.io.InputStream stream)
      • Stream

        public Stream​(Symbol structureClass,
                      java.io.Reader r)
      • Stream

        public Stream​(Symbol structureClass,
                      java.io.OutputStream stream)
      • Stream

        public Stream​(Symbol structureClass,
                      java.io.Writer w)
      • Stream

        public Stream​(Symbol structureClass,
                      java.io.InputStream inputStream,
                      LispObject elementType)
      • Stream

        public Stream​(Symbol structureClass,
                      java.io.InputStream inputStream,
                      LispObject elementType,
                      boolean interactive)
      • Stream

        public Stream​(Symbol structureClass,
                      java.io.OutputStream outputStream,
                      LispObject elementType)
      • Stream

        public Stream​(Symbol structureClass,
                      java.io.OutputStream outputStream,
                      LispObject elementType,
                      LispObject format)
      • Stream

        public Stream​(Symbol structureClass,
                      java.io.OutputStream outputStream,
                      LispObject elementType,
                      boolean interactive)
    • Method Detail

      • initAsCharacterInputStream

        protected void initAsCharacterInputStream​(java.io.Reader reader)
      • initAsBinaryInputStream

        protected void initAsBinaryInputStream​(java.io.InputStream in)
      • initAsCharacterOutputStream

        protected void initAsCharacterOutputStream​(java.io.Writer writer)
      • initAsBinaryOutputStream

        protected void initAsBinaryOutputStream​(java.io.OutputStream out)
      • isInputStream

        public boolean isInputStream()
      • isOutputStream

        public boolean isOutputStream()
      • isCharacterInputStream

        public boolean isCharacterInputStream()
      • isBinaryInputStream

        public boolean isBinaryInputStream()
      • isCharacterOutputStream

        public boolean isCharacterOutputStream()
      • isBinaryOutputStream

        public boolean isBinaryOutputStream()
      • isInteractive

        public boolean isInteractive()
      • setInteractive

        public void setInteractive​(boolean b)
      • getExternalFormat

        public LispObject getExternalFormat()
      • getEncoding

        public java.lang.String getEncoding()
      • setExternalFormat

        public void setExternalFormat​(LispObject format)
      • availableEncodings

        public static java.util.List<Symbol> availableEncodings()
      • isOpen

        public boolean isOpen()
      • setOpen

        public void setOpen​(boolean b)
      • getElementType

        public LispObject getElementType()
      • getOffset

        public int getOffset()
      • getLineNumber

        public int getLineNumber()
      • setWriter

        protected void setWriter​(java.io.Writer writer)
      • getCharPos

        public int getCharPos()
      • setCharPos

        public void setCharPos​(int n)
      • skipBalancedComment

        public void skipBalancedComment()
      • invert

        public static final java.lang.String invert​(java.lang.String s,
                                                    java.util.BitSet flags)
      • readDelimitedList

        public LispObject readDelimitedList​(char delimiter)
      • getFilePosition

        public LispObject getFilePosition()
      • freshLine

        public LispObject freshLine()
        Emit a newline unless at character position zero Return T if newline was emitted, NIL otherwise
      • print

        public void print​(char c)
      • _readChar

        protected int _readChar()
                         throws java.io.IOException
        Reads a character off an underlying stream
        Returns:
        a character, or -1 at end-of-file
        Throws:
        java.io.IOException
      • _unreadChar

        protected void _unreadChar​(int n)
                            throws java.io.IOException
        Puts a character back into the (underlying) stream
        Parameters:
        n -
        Throws:
        java.io.IOException
      • _charReady

        protected boolean _charReady()
                              throws java.io.IOException
        Returns a boolean indicating input readily available
        Returns:
        true if a character is available
        Throws:
        java.io.IOException
      • _byteReady

        protected boolean _byteReady()
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • _writeChar

        public void _writeChar​(char c)
        Writes a character into the underlying stream, updating charPos while doing so
        Parameters:
        c -
      • _writeChars

        public void _writeChars​(char[] chars,
                                int start,
                                int end)
        Writes a series of characters in the underlying stream, updating charPos while doing so
        Parameters:
        chars -
        start -
        end -
      • _writeString

        public void _writeString​(java.lang.String s)
        Writes a string to the underlying stream, updating charPos while doing so
        Parameters:
        s -
      • _writeLine

        public void _writeLine​(java.lang.String s)
        Writes a string to the underlying stream, appending a new line and updating charPos while doing so
        Parameters:
        s -
      • _readByte

        public int _readByte()
        Reads an 8-bit byte off the underlying stream
        Returns:
      • _writeByte

        public void _writeByte​(int n)
        Writes an 8-bit byte off the underlying stream
        Parameters:
        n -
      • _finishOutput

        public void _finishOutput()
        Flushes any buffered output in the (underlying) stream
      • _clearInput

        public void _clearInput()
        Reads all input from the underlying stream, until _charReady() indicates no more input to be available
      • _getFilePosition

        protected long _getFilePosition()
        Returns a (non-negative) file position integer or a negative value if the position cannot be determined.
        Returns:
        non-negative value as a position spec
      • _setFilePosition

        protected boolean _setFilePosition​(LispObject arg)
        Sets the file position based on a position designator passed in arg
        Parameters:
        arg - File position specifier as described in the CLHS
        Returns:
        true on success, false on failure
      • _close

        public void _close()
        Closes the stream and underlying streams
      • printStackTrace

        public void printStackTrace​(java.lang.Throwable t)
      • streamNotInputStream

        protected LispObject streamNotInputStream()
      • streamNotCharacterInputStream

        protected LispObject streamNotCharacterInputStream()
      • streamNotOutputStream

        protected LispObject streamNotOutputStream()
      • streamNotBinaryOutputStream

        protected LispObject streamNotBinaryOutputStream()
      • streamNotCharacterOutputStream

        protected LispObject streamNotCharacterOutputStream()
      • getWrappedInputStream

        public java.io.InputStream getWrappedInputStream()
      • getWrappedOutputStream

        public java.io.OutputStream getWrappedOutputStream()
      • getWrappedWriter

        public java.io.Writer getWrappedWriter()
      • getWrappedReader

        public java.io.PushbackReader getWrappedReader()