MCPcopy Create free account
hub / github.com/apache/thrift / LookaheadReader

Class LookaheadReader

lib/py/src/protocol/TJSONProtocol.py:153–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151
152
153class LookaheadReader():
154 hasData = False
155 data = ''
156
157 def __init__(self, protocol):
158 self.protocol = protocol
159
160 def read(self):
161 if self.hasData is True:
162 self.hasData = False
163 else:
164 self.data = self.protocol.trans.read(1)
165 return self.data
166
167 def peek(self):
168 if self.hasData is False:
169 self.data = self.protocol.trans.read(1)
170 self.hasData = True
171 return self.data
172
173
174class TJSONProtocolBase(TProtocolBase):

Callers 1

resetReadContextMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected