added support for reading writing binary data