Class

org.apache.daffodil.io

InputSource

Related Doc: package io

Permalink

abstract class InputSource extends AnyRef

The InputSource class is really just a mechanism to provide bytes an InputSourceDataInputStream, which does the heavily lift about converter bits/bytes to numbers and characters. This class does not need to know anything about bits, it is purely byte centric. One core difference from this vs an InputStream is that is must have the capability to backtrack to arbitrary points in the InputStreams history. To aide in this, methods are called to let the InputSource know which byte positions might we might need to backtrack to, which can allow it to free data that know longer is needed. One can almost thing of things as an InputStream that supports multiple marks with random access.

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. InputSource
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new InputSource()

    Permalink

Abstract Value Members

  1. abstract def areBytesAvailable(nBytes: Long): Boolean

    Permalink

    Determine whether the underlying data has the specified number of bytes available starting at the current byte position.

    Determine whether the underlying data has the specified number of bytes available starting at the current byte position. This function must block until either nBytes are known to be available or end-of-file is reached. This does not advance the current position.

    nBytes

    the number of bytes to determine if are available

    returns

    true if nBytes are available, false otherwise

  2. abstract def bytesAvailable(): Long

    Permalink

    Return the number of currently available bytes.

    Return the number of currently available bytes.

    This should not be used to determine the length of the data, as more bytes may become available in the future. This should really only be used for debug purposes.

  3. abstract def compact(): Unit

    Permalink

    Alerts the implementation to attempt to free data that is no longer used, if possible.

    Alerts the implementation to attempt to free data that is no longer used, if possible. If possible, this should free any unlocked bytes.

  4. abstract def get(dest: Array[Byte], off: Int, len: Int): Boolean

    Permalink

    Return a byte array with data from the current byte position.

    Return a byte array with data from the current byte position.

    Stores the next len bytes of data in dest starting at index off. In len bytes are not available or len bytes cannot fit in the dest array starting at the given offset, the dest array is not modified and false is returned.

    returns

    true if len bytes are available and written to the dest array, false otherwise

  5. abstract def get(): Int

    Permalink

    Return a single byte at the current byte position with a value in the range of 0 to 255.

    Return a single byte at the current byte position with a value in the range of 0 to 255.

    Increments the current byte position if successful.

    returns

    the byte at the current byte position if it exists, or -1 if EOF is reached.

  6. abstract def lockPosition(bytePos0b: Long): Unit

    Permalink

    Set the specified byte position as a location that that one may want to call setPosition in the future.

    Set the specified byte position as a location that that one may want to call setPosition in the future. This is essentially setting a mark in the data that can be reset back to later. Implementations are allowed to free any bytes before a locked byte position. Any bytes after a locked position cannot be freed until that lock is release.

    Note that this "lock" has nothing to do with synchronization, but behaves more like marks that must be accessable until released.

    bytePos0b

    the byte position to lock

  7. abstract def position(bytePos0b: Long): Unit

    Permalink

    Set the current byte position, using zero-based indexing

    Set the current byte position, using zero-based indexing

    bytPos0b cannot be greater than the most recent read data. In other words, this can only be used to move backwards in data.

    bytePos0b

    the new current byte position

  8. abstract def position(): Long

    Permalink

    Get the current byte position, using zero-based indexing

    Get the current byte position, using zero-based indexing

    returns

    the current byte position

  9. abstract def releasePosition(bytePos0b: Long): Unit

    Permalink

    Release a previously locked byte position, allowing the implementation to free any unlocked bytes.

    Release a previously locked byte position, allowing the implementation to free any unlocked bytes.

    bytePos0b

    the byte position to release

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. var _isValid: Boolean

    Permalink
    Attributes
    protected
  5. final def areDebugging: Boolean

    Permalink
  6. final def asInstanceOf[T0]: T0

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  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 hashCode(): Int

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

    Permalink
    Definition Classes
    Any
  14. final def isValid: Boolean

    Permalink
  15. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  18. final def setDebugging(setting: Boolean): Unit

    Permalink
  19. final def setInvalid: Unit

    Permalink
  20. final def synchronized[T0](arg0: ⇒ T0): T0

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped