require "cbor"
require "json"
if ARGV.size >= 1
puts "usage: json-to-cbor < file.json > file.cbor"
exit 0
end
json_content = JSON.parse STDIN.gets_to_end
STDOUT.write json_content.to_cbor