Changeset 15356 for trunk/abcl/contrib/abcl-introspect/util.lisp
- Timestamp:
- 07/30/20 12:20:16 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/contrib/abcl-introspect/util.lisp
r15282 r15356 6 6 (with-open-file (stream pathname 7 7 :direction :output 8 :element-type '( signed-byte 8))8 :element-type '(unsigned-byte 8)) 9 9 (dotimes (i (java:jarray-length class-bytes)) 10 10 (write-byte (java:jarray-ref class-bytes i) stream)))) 11 11 12 (export '(write-class) :extensions) 12 (defun read-class (pathname) 13 "Read the file at PATHNAME as a Java byte[] array" 14 (with-open-file (stream pathname 15 :direction :input 16 :element-type '(unsigned-byte 8)) 17 (let* ((length 18 (file-length stream)) 19 (array 20 (make-array length :element-type '(unsigned-byte 8)))) 21 (read-sequence array stream :end length) 22 (java:jnew-array-from-array "byte" array)))) 23 24 25 (export '(write-class 26 read-class) 27 :extensions) 13 28
Note: See TracChangeset
for help on using the changeset viewer.