Read and write type bit streams from Javascript.