resource closing test
refactoring
binary stream & byte array support added, small refactoring
binary stream & byte array tests added