Why use long type to store the data length in writeString() and readString() in DiskBasedCache, not int type.
Open
- Dominant language
- Java
- Stars
- 3.4k
- Forks
- 751
- Avg merge
- 8h 49m
- Merged PRs (30d)
- 2
Description
```
static void writeString(OutputStream os, String s) throws IOException {
byte[] b = s.getBytes("UTF-8");
writeLong(os, b.length);
os.write(b, 0, b.length);
}
static String readString(InputStream is) throws IOException {
int n = (int) readLong(is);
byte[] b = streamToBytes(is, n);
return new String(b, "UTF-8");
}
```
Contributor guide
Assessment
This issue has not been assessed yet.