read using bufferedinputstream