Skip to content

Commit

Permalink
docs updated smalltime
Browse files Browse the repository at this point in the history
  • Loading branch information
arekbulski committed Jan 17, 2020
1 parent c522be2 commit 2f5e76d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/streaming.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ Stream manipulation
Field wrappers
==============

Pointer allows for non-sequential construction. The pointer first moves the stream into new position, does the construction, and then restores the stream back to original position. This allows for random-access within the stream.
Pointer allows for non-sequential construction. The pointer first moves the stream into new position, does the construction, and then restores the stream back to original position. This allows for random access within the stream.

>>> d = Pointer(8, Bytes(1))
>>> d.parse(b"abcdefghijkl")
b'i'
>>> d.build(b"Z")
b'\x00\x00\x00\x00\x00\x00\x00\x00Z'

Peek parses a field but restores the stream position afterwards (it does peeking). Building does nothing, it does NOT defer to subcon.
Peek parses a field but restores the stream position afterwards (it peeks into the stream). Building does nothing, it does NOT defer to subcon.

>>> d = Sequence(Peek(Int16ul), Peek(Int16ub))
>>> d.parse(b"\x01\x02")
Expand Down

0 comments on commit 2f5e76d

Please sign in to comment.