Objectively
Objectively copied to clipboard
JSONReader, JSONWriter, Reader and Writer?
If the StringReader
proves useful, it'd make sense to introduce counterparts for other common stream operations, namely:
- Consider adding a Reader class that operates on Data just as StringReader operates on String.
- This class would be more straightforward, since it doesn't have to deal with Unicode directly.
- JSONReader and JSONWriter are currently private structs that operate on a Data instance. Might be nice to hoist these up to classes.
- It would be ideal if some inheritance model existed between these classes:
- Reader
- StringReader
- JSONReader -or- * JSONReader
This approach would diverge from Foundation's NSInputStream model, and that should be weighed before we go too far down this path also.