Class StreamSegmentMapperImpl

  • All Implemented Interfaces:
    StreamSegmentMapper

    class StreamSegmentMapperImpl
    extends java.lang.Object
    implements StreamSegmentMapper
    An implementation of the StreamSegmentMapper interface that requires an explicit list of the starting locations and lengths of the source segments.
    • Constructor Summary

      Constructors 
      Constructor Description
      StreamSegmentMapperImpl​(long[] segmentPositions, int[] segmentLengths)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      StreamSegment getStreamSegment​(long position, int length)
      Returns a StreamSegment object indicating the location of the initial portion of a desired segment in the source stream.
      void getStreamSegment​(long position, int length, StreamSegment seg)
      Sets the values of a StreamSegment object indicating the location of the initial portion of a desired segment in the source stream.
      (package private) long length()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • segmentPositions

        private long[] segmentPositions
      • segmentLengths

        private int[] segmentLengths
    • Constructor Detail

      • StreamSegmentMapperImpl

        public StreamSegmentMapperImpl​(long[] segmentPositions,
                                       int[] segmentLengths)
    • Method Detail

      • getStreamSegment

        public StreamSegment getStreamSegment​(long position,
                                              int length)
        Description copied from interface: StreamSegmentMapper
        Returns a StreamSegment object indicating the location of the initial portion of a desired segment in the source stream. The length of the returned StreamSegment may be smaller than the desired length.
        Specified by:
        getStreamSegment in interface StreamSegmentMapper
        Parameters:
        position - The desired starting position in the SegmentedImageInputStream, as a long.
        length - The desired segment length.
        Returns:
        a StreamSegment object
      • getStreamSegment

        public void getStreamSegment​(long position,
                                     int length,
                                     StreamSegment seg)
        Description copied from interface: StreamSegmentMapper
        Sets the values of a StreamSegment object indicating the location of the initial portion of a desired segment in the source stream. The length of the returned StreamSegment may be smaller than the desired length.
        Specified by:
        getStreamSegment in interface StreamSegmentMapper
        Parameters:
        position - The desired starting position in the SegmentedImageInputStream, as a long.
        length - The desired segment length.
        seg - A StreamSegment object to be overwritten.
      • length

        long length()