591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
|
return ret;
}
- (void)_seekToOffset: (off_t)offset
{
if (lseek(fd, offset, SEEK_SET) == -1)
@throw [OFSeekFailedException newWithClass: isa
stream: self];
}
- (off_t)_seekForwardWithOffset: (off_t)offset
{
off_t ret;
if ((ret = lseek(fd, offset, SEEK_CUR)) == -1)
@throw [OFSeekFailedException newWithClass: isa
stream: self];
return ret;
}
- (off_t)_seekToOffsetRelativeToEnd: (off_t)offset
{
off_t ret;
if ((ret = lseek(fd, offset, SEEK_END)) == -1)
@throw [OFSeekFailedException newWithClass: isa
stream: self];
return ret;
}
- (int)fileDescriptor
{
return fd;
|
|
>
>
|
>
>
|
>
>
|
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
|
return ret;
}
- (void)_seekToOffset: (off_t)offset
{
if (lseek(fd, offset, SEEK_SET) == -1)
@throw [OFSeekFailedException newWithClass: isa
stream: self
offset: offset
whence: SEEK_SET];
}
- (off_t)_seekForwardWithOffset: (off_t)offset
{
off_t ret;
if ((ret = lseek(fd, offset, SEEK_CUR)) == -1)
@throw [OFSeekFailedException newWithClass: isa
stream: self
offset: offset
whence: SEEK_CUR];
return ret;
}
- (off_t)_seekToOffsetRelativeToEnd: (off_t)offset
{
off_t ret;
if ((ret = lseek(fd, offset, SEEK_END)) == -1)
@throw [OFSeekFailedException newWithClass: isa
stream: self
offset: offset
whence: SEEK_END];
return ret;
}
- (int)fileDescriptor
{
return fd;
|