Trait

org.apache.daffodil.io

DataOutputStream

Related Doc: package io

Permalink

trait DataOutputStream extends DataStreamCommon with Logging

There is an asymmetry between DataInputStream and DataOutputStream with respect to the positions and limits in the bit stream.

For the DataInputStream, we have this concept of the current bitPos0b, and optionally there may be abound called bitLimit0b. There are 1b variants of these.

For parsing, these are always absolute values, that is they contain bit position relative the ultimate start of the input stream where parsing began.

For DataOutputStream, we have slightly different concepts.

There are absolute and relative variants. The absolute bitPosOb or absBitPos0b is symmetric to the parser's bitPos0b. It's the position relative to the ultimate start of the output stream.

However, we often do not know this value. So the UState and DataOutputStream have a maybeAbsBitPos0b which can be MaybeULong.Nope if the value isn't known.

In addition we have the relative or relBitPos0b. This is relative to the start of whatever buffer we are doing unparsing into.

When unparsing, we often have to unparse into a buffer where the ultimate actual absolute position isn't yet known, but we have to do the unparsing anyway, for example so that we can measure exactly how long something is.

Conversely, sometimes we simply must have the absolute output bit position, for example, when computing the number of bits to insert to achieve the required alignment.

Hence we have relBitPos0b - always known and is a value >= 0, and we have maybeAbsBitPos0b which is a MaybeULong. If known it is >=0.

Corresponding to bit position we have bit limit, which is measured in the same 0b or 1b units, but is *always* a maybe type, because even in the case where we know the absolute position, we still may or may not have any limit in place. Hence the UState and DataOutputStream have a

maybeRelBitLimit0b

and

maybeAbsBitLimit0b.

One invariant is this: when the absolute bit pos is known, then it is the same as the relative bit pos. Similarly when the absolute bit limit is known, then the relative bit limit is known and is equal.

Linear Supertypes
Logging, Identity, DataStreamCommon, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DataOutputStream
  2. Logging
  3. Identity
  4. DataStreamCommon
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def align(bitAlignment1b: Int, finfo: FormatInfo): Boolean

    Permalink

    advances the bit position to the specified alignment.

    advances the bit position to the specified alignment.

    Note that the bitAlignment1b argument is 1-based.

    Passing 0 as the argument is a usage error.

    Passing 1 as the argument performs no alignment, as any bit position is 1-bit aligned.

    For any other value, the bit position (1-based) is advanced to the next multiple of that argument value.

    False is returned if there are insufficient available bits to achieve the alignment.

    Definition Classes
    DataStreamCommon
  2. abstract def areDebugging: Boolean

    Permalink

    Debugging flag.

    Debugging flag. If set then performance may be reduced, but historic and upcoming data may be viewed using the pastData and futureData methods.

    This should be set at the beginning of execution. If it is set after data has been accessed then IllegalStateException is thrown.

    Definition Classes
    DataStreamCommon
  3. abstract def chunkSizeInBytes: Int

    Permalink

    These values are used for output streams that could change from ByteArray's to File based output streams.

  4. abstract def cleanUp(): Unit

    Permalink

    This function deletes any temnporary files that have been generated

  5. abstract def futureData(nBytesRequested: Int): ByteBuffer

    Permalink
    Definition Classes
    DataStreamCommon
  6. abstract def id: String

    Permalink
  7. abstract def isAligned(bitAlignment1b: Int): Boolean

    Permalink

    For assertion checking really.

    For assertion checking really. Optimizations should remove the need for most alignment operations. This can be used in assertions that check that this is working properly.

    Note that the bitAlignment1b argument is 1-based.

    Passing 0 as the argument is a usage error.

    Passing 1 as the argument performs no alignment, as any bit position is 1-bit aligned.

    Definition Classes
    DataStreamCommon
  8. abstract def isFinished: Boolean

    Permalink
  9. abstract def maxBufferSizeInBytes: Long

    Permalink
  10. abstract def maybeAbsBitLimit0b: MaybeULong

    Permalink

    Absolute bit limit zero based

    Absolute bit limit zero based

    If defined it is the position 1 bit past the last bit location that can be written. So if we at starting at bitPos0b of 0, and we allow only 100 bits, then the bit positions are 0 to 99, and the bit limit is 100.

  11. abstract def maybeAbsBitPos0b: MaybeULong

    Permalink
  12. abstract def maybeExistingFile: Maybe[Path]

    Permalink

    maybeExistingFile is used in the case of blob files, where we already have an existing file containing the data.

    maybeExistingFile is used in the case of blob files, where we already have an existing file containing the data. This is the path to said file.

  13. abstract def maybeNextInChain: Maybe[DataOutputStream]

    Permalink
  14. abstract def maybeRelBitLimit0b: MaybeULong

    Permalink

    Relative bit limit zero based

  15. abstract def pastData(nBytesRequested: Int): ByteBuffer

    Permalink

    Access to historic (past data) and upcoming data for purposes of display in a trace or debugger.

    Access to historic (past data) and upcoming data for purposes of display in a trace or debugger.

    If areDebugging is false, these throw IllegalStateException

    Definition Classes
    DataStreamCommon
  16. abstract def putBigInt(bigInt: BigInteger, bitLengthFrom1: Int, signed: Boolean, finfo: FormatInfo): Boolean

    Permalink

    If bitLengthFrom1 bits are available to be written before bitLimit0b (if defined) is encountered, then this writes the bitLengthFrom1 least significant bits of the bigInt using the current bit order and byte order, and returns true.

    If bitLengthFrom1 bits are available to be written before bitLimit0b (if defined) is encountered, then this writes the bitLengthFrom1 least significant bits of the bigInt using the current bit order and byte order, and returns true. The signed flag determines whether or not the output should be output as a signed or unsigned type.

    If not enough bits are available or the big integer cannot fit into bitLengthFrom1 bits, this writes nothing and returns false.

    It is a usage error if signed is false and bigInt is a negative BigInteger.

    It is a usage error if bitLengthFrom1 is not greater than or equal to 1.

  17. abstract def putBinaryDouble(v: Double, finfo: FormatInfo): Boolean

    Permalink
  18. abstract def putBinaryFloat(v: Float, finfo: FormatInfo): Boolean

    Permalink

    Float and Double

    Float and Double

    These are unparsed per the currently set BinaryFloatRep, byteOrder, and bitOrder

    Returns false if there are not 32 bits or 64 bits (respectively) available.

  19. abstract def putByteArray(ba: Array[Byte], bitLengthFrom1: Int, finfo: FormatInfo, ignoreByteOrder: Boolean = false): Boolean

    Permalink

    If bitLengthFrom1 bits are available to be written before bitLimit0b (if defined) is encountered, then this writes the bitLengthFrom1 bits of the ba using the current bit order and byte order, and returns true.

    If bitLengthFrom1 bits are available to be written before bitLimit0b (if defined) is encountered, then this writes the bitLengthFrom1 bits of the ba using the current bit order and byte order, and returns true. The array is assumed to be have bigEndian byte order and most significant bit first bit order.

    If not enough bits are available, this writes nothing and returns false.

    ignoreByteOrder is used when we are working with a FileOutputStream. Given that the bytes are already converted to BigEndian when they are written out to a file, we no longer need to convert little endian arrays so byte order can be ignored.

    It is a usage error if bitLengthFrom1 is not greater than or equal to 1.

  20. abstract def putCharBuffer(cb: CharBuffer, finfo: FormatInfo): Long

    Permalink
  21. abstract def putLong(signedLong: Long, bitLengthFrom1To64: Int, finfo: FormatInfo): Boolean

    Permalink

    If bitLengthFrom1To64 bits are available to be written before bitLimit0b (if defined) is encountered, then this writes the bitLengthFrom1To64 least significant bits of the long using the current bit order and byte order, and returns true.

    If bitLengthFrom1To64 bits are available to be written before bitLimit0b (if defined) is encountered, then this writes the bitLengthFrom1To64 least significant bits of the long using the current bit order and byte order, and returns true.

    If not enough bits are available, this writes nothing and returns false.

    It is a usage error if bitLengthFrom1To64 is not in the range 1 to 64 inclusive.

  22. abstract def putString(str: String, finfo: FormatInfo): Long

    Permalink

    Returns number of characters transferred.

    Returns number of characters transferred. Stops when the bitLimit is encountered if one is defined.

  23. abstract def putULong(unsignedLong: ULong, bitLengthFrom1To64: Int, finfo: FormatInfo): Boolean

    Permalink

    If bitLengthFrom1To64 bits are available to be written before bitLimit0b (if defined) is encountered, then this writes the bitLengthFrom1To64 least significant bits of the long using the current bit order and byte order, and returns true.

    If bitLengthFrom1To64 bits are available to be written before bitLimit0b (if defined) is encountered, then this writes the bitLengthFrom1To64 least significant bits of the long using the current bit order and byte order, and returns true.

    If not enough bits are available, this writes nothing and returns false.

    It is a usage error if bitLengthFrom1To64 is not in the range 1 to 64 inclusive.

  24. abstract def relBitPos0b: ULong

    Permalink
  25. abstract def remainingBits: MaybeULong

    Permalink

    Returns number of bits remaining (if a limit is defined).

    Returns number of bits remaining (if a limit is defined). Nope if not defined.

    Definition Classes
    DataStreamCommon
  26. abstract def resetMaybeRelBitLimit0b(savedBitLimit0b: MaybeULong): Unit

    Permalink
  27. abstract def setDebugging(setting: Boolean): Unit

    Permalink
    Definition Classes
    DataStreamCommon
  28. abstract def setFinished(finfo: FormatInfo): Unit

    Permalink

    close-out this output stream.

    close-out this output stream. No more writing to this after.

  29. abstract def setMaybeRelBitLimit0b(newMaybeRelBitLimit0b: MaybeULong, reset: Boolean = false): Boolean

    Permalink

    sets, but also maintains the absolute bit limit, if that is defined.

    sets, but also maintains the absolute bit limit, if that is defined.

    Attributes
    protected
  30. abstract def setRelBitPos0b(newRelBitPos0b: ULong): Unit

    Permalink

    Besides setting the relBitPos, it also maintains the value of the absolute bit pos, if it is known.

    Besides setting the relBitPos, it also maintains the value of the absolute bit pos, if it is known.

    Attributes
    protected
  31. abstract def skip(nBits: Long, finfo: FormatInfo): Boolean

    Permalink

    Advances the bit position by nBits.

    Advances the bit position by nBits. If nBits aren't available this returns false. Otherwise it returns true.

    Definition Classes
    DataStreamCommon
  32. abstract def tempDirPath: File

    Permalink
  33. abstract def validateFinalStreamState: Unit

    Permalink

    Called once after each parse operation to verify final invariants for the implementation.

    Called once after each parse operation to verify final invariants for the implementation.

    Use to perform checks such as that data structures held in pools are all returned before end of parse.

    Definition Classes
    DataStreamCommon
  34. abstract def zeroLengthStatus: ZeroLengthStatus

    Permalink

Concrete Value Members

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def areLogging(lvl: Type): Boolean

    Permalink
    Definition Classes
    Logging
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def doLogging(lvl: Type, msg: String, args: Seq[Any]): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  12. def getLogWriter(): LogWriter

    Permalink
    Definition Classes
    Logging
  13. final def getLoggingLevel(): Type

    Permalink
    Definition Classes
    Logging
  14. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  15. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  16. final macro def log(lvl: Type, msg: String, args: Any*): Unit

    Permalink
    Definition Classes
    Logging
  17. lazy val logID: String

    Permalink
    Definition Classes
    Logging → Identity
  18. var logLevel: Maybe[Type]

    Permalink
    Definition Classes
    Logging
  19. var logWriter: Maybe[LogWriter]

    Permalink
    Definition Classes
    Logging
  20. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  21. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  22. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  23. final def relBitPos1b: ULong

    Permalink
  24. def setLogWriter(lw: LogWriter): Unit

    Permalink
    Definition Classes
    Logging
  25. def setLoggingLevel(level: Type): Unit

    Permalink
    Definition Classes
    Logging
  26. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  27. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  28. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. macro def withLoggingLevel[S](newLevel: Type)(body: ⇒ S): Unit

    Permalink
    Definition Classes
    Logging

Inherited from Logging

Inherited from Identity

Inherited from DataStreamCommon

Inherited from AnyRef

Inherited from Any

Ungrouped