Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the smart-buffer Reference Manual, version 0.1, generated automatically by Declt version 3.0 "Montgomery Scott" on Tue Dec 22 15:04:18 2020 GMT+0.
• Introduction | What smart-buffer is all about | |
• Systems | The systems documentation | |
• Modules | The modules documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
Smart-buffer provides an output buffer which changes the destination depending on content size.
In-memory buffer is fast to read/write, however, it consumes much memory if the data can be large. On the other hand, files on disk are slower. Smart-buffer would be useful when the buffer must satisfy these two contradicting demands.
with-smart-buffer
returns an in-memory stream or a file stream.
(with-smart-buffer (buffer)
(write-to-buffer buffer (flex:string-to-octets "foobar")))
;=> #<FLEXI-STREAMS::VECTOR-INPUT-STREAM {100456A9A3}>
(with-smart-buffer (buffer :memory-limit 3)
(write-to-buffer buffer (flex:string-to-octets "foobar")))
;=> #<SB-SYS:FD-STREAM for "file /private/var/folders/x3/8n07clk15tq3m4y6_yrmjy6c0000gn/T/tmpAR3FSGEY.tmp" {1005D06503}>
Copyright (c) 2015 Eitaro Fukamachi (e.arrows@gmail.com)
Licensed under the BSD 3-Clause License.
Next: Modules, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The smart-buffer system |
Eitaro Fukamachi
BSD 3-Clause
Smart octets buffer
# smart-buffer
[](https://travis-ci.org/fukamachi/smart-buffer)
[](https://coveralls.io/r/fukamachi/smart-buffer)
Smart-buffer provides an output buffer which changes the destination depending on content size.
* In-memory buffer for small data
* Temporary files on disk for big data
In-memory buffer is fast to read/write, however, it consumes much memory if the data can be large. On the other hand, files on disk are slower. Smart-buffer would be useful when the buffer must satisfy these two contradicting demands.
## Usage
‘with-smart-buffer‘ returns an in-memory stream or a file stream.
“‘common-lisp
(with-smart-buffer (buffer)
(write-to-buffer buffer (flex:string-to-octets "foobar")))
;=> #<FLEXI-STREAMS::VECTOR-INPUT-STREAM {100456A9A3}>
(with-smart-buffer (buffer :memory-limit 3)
(write-to-buffer buffer (flex:string-to-octets "foobar")))
;=> #<SB-SYS:FD-STREAM for "file /private/var/folders/x3/8n07clk15tq3m4y6_yrmjy6c0000gn/T/tmpAR3FSGEY.tmp" {1005D06503}>
“‘
## Author
* Eitaro Fukamachi (e.arrows@gmail.com)
## Copyright
Copyright (c) 2015 Eitaro Fukamachi (e.arrows@gmail.com)
## License
Licensed under the BSD 3-Clause License.
0.1
smart-buffer.asd (file)
src (module)
Modules are listed depth-first from the system components tree.
• The smart-buffer/src module |
smart-buffer (system)
src/
smart-buffer.lisp (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
• The smart-buffer.asd file | ||
• The smart-buffer/src/smart-buffer.lisp file |
Next: The smart-buffer/src/smart-buffer․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
smart-buffer.asd
smart-buffer (system)
Previous: The smart-buffer․asd file, Up: Lisp files [Contents][Index]
src (module)
src/smart-buffer.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The smart-buffer-asd package | ||
• The smart-buffer package |
Next: The smart-buffer package, Previous: Packages, Up: Packages [Contents][Index]
smart-buffer.asd
Previous: The smart-buffer-asd package, Up: Packages [Contents][Index]
smart-buffer.lisp (file)
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported special variables | ||
• Exported macros | ||
• Exported functions | ||
• Exported conditions | ||
• Exported structures |
Next: Exported macros, Previous: Exported definitions, Up: Exported definitions [Contents][Index]
smart-buffer.lisp (file)
smart-buffer.lisp (file)
Next: Exported functions, Previous: Exported special variables, Up: Exported definitions [Contents][Index]
smart-buffer.lisp (file)
Next: Exported conditions, Previous: Exported macros, Up: Exported definitions [Contents][Index]
smart-buffer.lisp (file)
smart-buffer.lisp (file)
smart-buffer.lisp (file)
smart-buffer.lisp (file)
Next: Exported structures, Previous: Exported functions, Up: Exported definitions [Contents][Index]
smart-buffer.lisp (file)
error (condition)
:limit
(quote nil)
Previous: Exported conditions, Up: Exported definitions [Contents][Index]
smart-buffer.lisp (file)
structure-object (structure)
smart-buffer:*default-memory-limit*
buffer-memory-limit (function)
(setf buffer-memory-limit) (function)
smart-buffer:*default-disk-limit*
buffer-disk-limit (function)
(setf buffer-disk-limit) (function)
0
buffer-current-len (function)
(setf buffer-current-len) (function)
t
buffer-on-memory-p (function)
(setf buffer-on-memory-p) (function)
(xsubseq:make-concatenated-xsubseqs)
buffer-memory-buffer (function)
(setf buffer-memory-buffer) (function)
buffer-disk-buffer (function)
(setf buffer-disk-buffer) (function)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal functions |
Previous: Internal definitions, Up: Internal definitions [Contents][Index]
smart-buffer.lisp (file)
smart-buffer.lisp (file)
smart-buffer.lisp (file)
smart-buffer.lisp (file)
smart-buffer.lisp (file)
smart-buffer.lisp (file)
smart-buffer.lisp (file)
smart-buffer.lisp (file)
smart-buffer.lisp (file)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | F L M S |
---|
Jump to: | F L M S |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | %
(
B C F M S W |
---|
Jump to: | %
(
B C F M S W |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | *
C D L M O S |
---|
Jump to: | *
C D L M O S |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | B C P S |
---|
Jump to: | B C P S |
---|