com.twitter.scalding.serialization.JavaStreamEnrichments
If s supports marking, we mark it.
If s supports marking, we mark it. Otherwise we read the needed bytes out into a ByteArrayStream and return that. This is intended for the case where you need possibly read size bytes but may stop early, then skip this exact number of bytes. Intended use is: {code} val size = 100 val marked = s.markOrBuffer(size) val y = fn(marked) marked.reset marked.skipFully(size) {/code}
Like read, but throws eof on error
This is the algorithm from DataInputStream it was also benchmarked against the approach used in readLong and found to be faster
This reads a varInt encoding that only encodes non-negative numbers.
This reads a varInt encoding that only encodes non-negative numbers. It uses: 1 byte for values 0 - 255, 3 bytes for 256 - 65535, 7 bytes for 65536 - Int.MaxValue
This has a lot of methods from DataInputStream without having to allocate to get them This code is similar to those algorithms