Changeset 14820


Ignore:
Timestamp:
Jun 10, 2011, 11:02:40 PM (8 years ago)
Author:
gz
Message:

Add a couple stream-length methods

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-1/l1-streams.lisp

    r14580 r14820  
    47184718 
    47194719 
     4720(defmethod stream-length ((s string-input-stream) &optional new)
     4721  (unless new
     4722    (let ((ioblock (basic-stream-ioblock s)))
     4723      (%i- (string-input-stream-ioblock-end ioblock)
     4724           (string-input-stream-ioblock-start ioblock)))))
     4725
    47204726(defmethod stream-eofp ((s string-input-stream))
    47214727  (let* ((ioblock (basic-stream-ioblock s))
     
    65936599      (the fixnum (- (the fixnum (io-buffer-idx inbuf)) origin)))))
    65946600
     6601(defmethod stream-length ((s vector-input-stream) &optional new)
     6602  (unless new
     6603    (let ((ioblock (basic-stream-ioblock s)))
     6604      (%i- (io-buffer-limit (ioblock-inbuf ioblock))
     6605           (vector-stream-ioblock-displacement ioblock)))))
     6606
     6607
    65956608; end of L1-streams.lisp
Note: See TracChangeset for help on using the changeset viewer.