Package

breeze

io

Permalink

package io

Visibility
  1. Public
  2. All

Type Members

  1. abstract class ByteConverter extends AnyRef

    Permalink

    Reads and writes data from byte values.

  2. class RandomAccessFile extends DataInput with DataOutput with Closeable

    Permalink

    Wrapper for java.io.RandomAccessFile.

    Wrapper for java.io.RandomAccessFile.

    The main differences to java.io.RandomAccessFile are (1) naming (e.g. default naming is readInt64 instead of readLong) (2) the readXXX(n: Int) functions, which will try to read n samples from the file. (Try to use these functions instead of reading multiple times in a loop with readXXX(), as each individual read is costly in terms of performance. * Each function throws a java.io.IOException (including subclass java.io.EOFException). These can be caught in Scala if necessary, to detect ends of files when reading, for example. Catching is obligatory in Java.

    Type Java Type Scala Type Value Range
    Int8: Signed 8-bit integer byte Byte [-128, 127]
    UInt8: Unsigned 8-bit integer (int) (Int) [0, 255]
    Int16: Signed 16-bit integer short Short [-32768, 32767]
    UInt16: Unsigned 16-bit integer char Char [0, 65535]
    Int32: Signed 32-bit integer int Int [-2147483648, 2147483647]
    UInt32: Unsigned 32-bit integer (long) (Long) [0, 4294967295]
    Int64: Signed 64-bit integer long Long [-9223372036854775808, 9223372036854775807]
    UInt64: Unsigned 64-bit integer* (spire.math.Ulong) (spire.math.ULong) [0, 18446744073709551615]
    UInt64Shifted: Unsigned 64-bit integer, shifted to signed range* (long)* (Long)* [0, 18446744073709551615*]

    *note: given that the JVM/Scala does not have a UInt64 type, nor a Int128 to promote to, UInt64s are dealt with in two ways... (1) as a spire.math.ULong (which represents UInt64 wrapped as a regular Long where the negative values represent their unsigned two's complement equivalent:

    Unsigned ULong value Internal Long (signed) wrapped by ULong
    0 0
    2^63-1 2^63-1
    2^63 -2^63
    2^64-1 -1

    or (2) as a shifted Int64, where UInt64 is shifted down by 2^63 in its range to cover both positive and negative values of Int64 (this is compatible with + and -, for use as timestamps, for example, but is of course not compatible with * and / operations)

    *implementation note: this class was not overriden from java.io.RandomAccessFile or implicitly "pimped," but instead passes through to java.io.RandomAccessFile. This is mainly because the java.io.RandomAccessFile.readXXX functions are declared final, and cannot be overridden.

Value Members

  1. object ByteConverterBigEndian extends ByteConverter

    Permalink

    See breeze.io.ByteConverter, reads big endian.

  2. object ByteConverterLittleEndian extends ByteConverter

    Permalink

    See breeze.io.ByteConverter, reads little endian.

  3. object CSVReader

    Permalink

    Just a simple wrapper for OpenCSV's csvreader.

  4. object CSVWriter

    Permalink

    Just a simple wrapper for OpenCSV's csvreader.

  5. object FileStreams

    Permalink

    Gets input and output streams to a file, wrapping them in GZIP streams if the file ends with .gz.

Ungrouped