added length, position, readBytes to stream.js