J.Input.Data

opaque type Data

J.Input.Data is an opaque value, backed by java.io.DataInputStream

Source
Data.scala

Def

inline def boolean: Boolean

Read Boolean

Read Boolean

Reads and returns one input short. The short is treated as a signed value in the range -128 through 127, inclusive

This method is suitable for reading the short written by the J.Output.Data.short method

Source
Data.scala
inline def byte: Byte
inline def char: Char

Read Char

Read Char

Reads two input byte and returns a char value. Let a be the first short read and b be the second short

The value returned is: (char)((a << 8) | (b & 0xff))

This method is suitable for reading byte written by the J.Output.Data.char method

Source
Data.scala
inline def double: Double

Read Double

Read Double

Reads eight input byte and returns a double value

It does this by first constructing a long value in exactly the manner of the readlong method, then converting this long value to a double in exactly the manner of the method Double.longBitsToDouble

This method is suitable for reading byte written by the J.Output.Data.double method of interface DataOutput

Source
Data.scala
inline def float: Float

Read Float

Read Float

Reads four input byte and returns a float value.

It does this by first constructing an int value in exactly the manner of the readInt method, then converting this int value to a float in exactly the manner of the method Float.intBitsToFloat

This method is suitable for reading byte written by the J.Output.Data.float method

Source
Data.scala
inline def int: Int

Read Int

Read Int

Reads four input byte and returns an int value. Let a-d be the first through fourth byte read. The value returned is:

(((a & 0xff) << 24) | ((b & 0xff) << 16) | ((c & 0xff) << 8) | (d & 0xff))

This method is suitable for reading byte written by the J.Output.Data.int method

Source
Data.scala
inline def long: Long

Read Long

Read Long

Reads eight input byte and returns a long value. Let a-h be the first through eighth byte read. The value returned is:

(((long)(a & 0xff) << 56) | ((long)(b & 0xff) << 48) | ((long)(c & 0xff) << 40) | ((long)(d & 0xff) << 32) | ((long)(e & 0xff) << 24) | ((long)(f & 0xff) << 16) | ((long)(g & 0xff) << 8) | ((long)(h & 0xff)))

This method is suitable for reading byte written by the J.Output.Data.long method

Source
Data.scala
inline def readFully(ba: Array[Byte]): Unit
inline def readFully(ba: Array[Byte], from: Int, size: Int): Unit
inline def real: java.io.DataInputStream

Real value

Real value

Returns real value standing behind the opaque type.

This is a zero cost call.

Inherited from
_methods
Source
Base.scala
inline def short: Short

Read Short

Read Short

Reads two input byte and returns a short value. Let a be the first short read and b be the second short

The value returned is: (short)((a << 8) | (b & 0xff))

This method is suitable for reading the byte written by the J.Output.Data.short method

Source
Data.scala
inline def skipBytes(n: Int): Int
inline def unsignedByte: Int

Read unsignedByte

Read unsignedByte

Reads one input short, zero-extends it to type int, and returns the result, which is therefore in the range 0 through 255

This method is suitable for reading the short written by the J.Output.Data.short method if the argument to writeByte was intended to be a value in the range 0 through 255

Source
Data.scala
inline def unsignedShort: Int

Read unsignedShort

Read unsignedShort

Reads two input byte and returns an int value in the range 0 through 65535. Let a be the first short read and b be the second short

The value returned is: (((a & 0xff) << 8) | (b & 0xff))

This method is suitable for reading the byte written by the J.Output.Data.short method if the argument to J.Output.Data.short was intended to be a value in the range 0 through 65535

Source
Data.scala
inline def utf: String

Read UTF String

Read UTF String

Details

The J.Output.Data.utf method may be used to write data that is suitable for reading by this method

Source
Data.scala