exports.String = function (str) {
	return Buffer.concat([exports.Int32(str.length), new Buffer(str)]);
}

exports.Int32 = function (n) {
	return new Buffer([(n >> 24) & 0xFF, (n >> 16) & 0xFF, (n >> 8) & 0xFF, n & 0xFF]);
}

exports.getInt32 = function (buf) {
	return (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3];
}