Skip to content

Commit 1392355

Browse files
committed
Add readpartial alias.
1 parent fd23da0 commit 1392355

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/protocol/http/body/stream.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ def read_partial(length = nil)
9898
return buffer
9999
end
100100

101+
def readpartial
102+
read_partial or raise EOFError, "End of file reached!"
103+
end
104+
101105
def read_nonblock(length, buffer = nil)
102106
@buffer ||= read_next
103107
chunk = nil

0 commit comments

Comments
 (0)