// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package websocket

import (
	
	
)

// WriteJSON writes the JSON encoding of v as a message.
//
// Deprecated: Use c.WriteJSON instead.
func ( *Conn,  interface{}) error {
	return .WriteJSON()
}

// WriteJSON writes the JSON encoding of v as a message.
//
// See the documentation for encoding/json Marshal for details about the
// conversion of Go values to JSON.
func ( *Conn) ( interface{}) error {
	,  := .NextWriter(TextMessage)
	if  != nil {
		return 
	}
	 := json.NewEncoder().Encode()
	 := .Close()
	if  != nil {
		return 
	}
	return 
}

// ReadJSON reads the next JSON-encoded message from the connection and stores
// it in the value pointed to by v.
//
// Deprecated: Use c.ReadJSON instead.
func ( *Conn,  interface{}) error {
	return .ReadJSON()
}

// ReadJSON reads the next JSON-encoded message from the connection and stores
// it in the value pointed to by v.
//
// See the documentation for the encoding/json Unmarshal function for details
// about the conversion of JSON to a Go value.
func ( *Conn) ( interface{}) error {
	, ,  := .NextReader()
	if  != nil {
		return 
	}
	 = json.NewDecoder().Decode()
	if  == io.EOF {
		// One value is expected in the message.
		 = io.ErrUnexpectedEOF
	}
	return 
}