Added write method to response
splitted bufferParser code