Ry Wiese

Results 21 comments of Ry Wiese

Okay I get I think. `BufReader` is a struct that wraps a `Reader` + everything it needs to do its own buffering, just the way java `BufferedReader` is a class...

Yeah there is https://docs.oracle.com/javase/8/docs/api/java/io/BufferedInputStream.html which does buffering, but reads bytes (not chars). so maybe this is the functionality we want to make instead? and not concern ourselves with char bufs...

Yeah so rust has a [BufReader](https://doc.rust-lang.org/std/io/struct.BufReader.html) which does what I described: > which does buffering, but reads bytes (not chars) and also implements the Rust `Reader`. So our `BufReader` should...

> and then we can later build something that handles decoding into chars So i've been working on building this on top of the linked PR, and have discovered some...

> Could you outline (not implement) a design that "fits best" with Java? Option 1: Rely on java types under the hood: ``` trait LineReader[t] with CharReader[t] { type Aef:...

This is the partial implementation that I had already started writing, using the existing `BufReader` as is (built on bytes). If we continue building on top of `BufReader` (buffering bytes),...

> In Option 1: > > ``` > + TcpSocket.TcpSocket(socket, inputStream, bufferedReader, outputStream) > ``` > > A stream can be both bytes or strings (e.g. images or text). If...

> Is it correct to say that there are two dimensions: Reading bytes and reading chars? Along another axis, reading buffered or unbuffered? Mostly yes, and i think it would...

> The associated type to Read sounds pretty nice. What would it look like in practice? How much needs to be duplicated? I'm working on a prototype to show what...

But with that said, I've made all requested changes to the `BufReader`. I think best would be to merge as-is, close this ticket, and then iterate. I can make some...