modified ByteReadAndWrite to read peer_id directory