package easyjson

import (
	
	
)

// RawMessage is a raw piece of JSON (number, string, bool, object, array or
// null) that is extracted without parsing and output as is during marshaling.
type RawMessage []byte

// MarshalEasyJSON does JSON marshaling using easyjson interface.
func ( *RawMessage) ( *jwriter.Writer) {
	if len(*) == 0 {
		.RawString("null")
	} else {
		.Raw(*, nil)
	}
}

// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface.
func ( *RawMessage) ( *jlexer.Lexer) {
	* = RawMessage(.Raw())
}

// UnmarshalJSON implements encoding/json.Unmarshaler interface.
func ( *RawMessage) ( []byte) error {
	* = 
	return nil
}

var nullBytes = []byte("null")

// MarshalJSON implements encoding/json.Marshaler interface.
func ( RawMessage) () ([]byte, error) {
	if len() == 0 {
		return nullBytes, nil
	}
	return , nil
}

// IsDefined is required for integration with omitempty easyjson logic.
func ( *RawMessage) () bool {
	return len(*) > 0
}