InputBuffer Class

The InputBuffer class decodes and translates raw data streams depending on the specified encoding. Python natively supports a wide range of languages and codecs. The InputBuffer is an argument to the process() method for both UDFilters and UDParsers. A user interacts with the UDL's data stream by calling methods of the InputBuffer

If you do not specify a value for setEncoding(), Vertica assumes a value of NONE.

class InputBuffer:
	def getSize(self):
		...
	def getOffset(self):
	...
	 
	def setEncoding(self, encoding):
		"""
		Set the encoding of the data contained in the underlying buffer
		"""
		pass

	def peek(self, length = None):
		"""
		Copy data from the input buffer into Python.
		If no encoding has been specified, returns a Bytes object containing raw data.
		Otherwise, returns data decoded into an object corresponding to the specified encoding
		(for example, 'utf-8' would return a string).
		If length is None, returns all available data.
		If length is not None then the length of the returned object is at most what is requested.
		This method does not advance the buffer offset.
		"""
		pass
 
	def read(self, length = None):
		"""
		See peek().
		This method does the same thing as peek(), but it also advances the
		buffer offset by the number of bytes consumed.
		"""
		pass
 
		# Advances the DataBuffer offset by a number of bytes equal to the result
		# of calling "read" with the same arguments.
		def advance(self, length = None):
		"""
		Advance the buffer offset by the number of bytes indicated by
		the length and encoding arguments.  See peek().
	Returns the new offset.
		"""
		pass