com.twitter.scalding.serialization.JavaStreamEnrichments

RichInputStream

implicit final class RichInputStream extends AnyVal

This has a lot of methods from DataInputStream without having to allocate to get them This code is similar to those algorithms

Linear Supertypes
AnyVal, NotNull, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. RichInputStream
  2. AnyVal
  3. NotNull
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RichInputStream(s: InputStream)

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  2. final def ##(): Int

    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  4. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  5. def getClass(): Class[_ <: AnyVal]

    Definition Classes
    AnyVal → Any
  6. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  7. def markOrBuffer(size: Int): InputStream

    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}

  8. def readBoolean: Boolean

  9. def readByte: Byte

    Like read, but throws eof on error

  10. def readChar: Char

  11. def readDouble: Double

  12. def readFloat: Float

  13. final def readFully(bytes: Array[Byte], offset: Int, len: Int): Unit

  14. final def readFully(bytes: Array[Byte]): Unit

  15. def readInt: Int

    This is the algorithm from DataInputStream it was also benchmarked against the approach used in readLong and found to be faster

  16. def readLong: Long

  17. final def readPosVarInt: Int

    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

  18. def readShort: Short

  19. def readUnsignedByte: Int

  20. def readUnsignedShort: Int

  21. val s: InputStream

  22. final def skipFully(count: Long): Unit

  23. def toString(): String

    Definition Classes
    Any

Inherited from AnyVal

Inherited from NotNull

Inherited from Any

Ungrouped