WIP write to inputstream