equal
deleted
inserted
replaced
217 ! ! |
217 ! ! |
218 |
218 |
219 !Stream class methodsFor:'defaults'! |
219 !Stream class methodsFor:'defaults'! |
220 |
220 |
221 bufferSizeForBulkCopy |
221 bufferSizeForBulkCopy |
|
222 "return the size of buffer used when copying big files/bulk data |
|
223 from one stream to another." |
|
224 |
222 ^ 128 * 1024 |
225 ^ 128 * 1024 |
223 |
226 |
224 "Created: / 13-03-2019 / 16:50:04 / Stefan Vogel" |
227 "Created: / 13-03-2019 / 16:50:04 / Stefan Vogel" |
|
228 "Modified (comment): / 13-03-2019 / 23:21:13 / Stefan Vogel" |
225 ! ! |
229 ! ! |
226 |
230 |
227 !Stream class methodsFor:'testing'! |
231 !Stream class methodsFor:'testing'! |
228 |
232 |
229 isAbstract |
233 isAbstract |
3668 copy:numberOfElementsOrNil into:outStream |
3672 copy:numberOfElementsOrNil into:outStream |
3669 "read from the receiver, and write numberOfElements elements to outStream, a WriteStream. |
3673 "read from the receiver, and write numberOfElements elements to outStream, a WriteStream. |
3670 Return the number of elements which have been transferred. |
3674 Return the number of elements which have been transferred. |
3671 If numberOfElementsOrNil is nil, copy until the end of myself." |
3675 If numberOfElementsOrNil is nil, copy until the end of myself." |
3672 |
3676 |
3673 ^ self copy:numberOfElementsOrNil into:outStream bufferSize:(self class bufferSizeForBulkCopy) |
3677 ^ self copy:numberOfElementsOrNil into:outStream bufferSize:(outStream class bufferSizeForBulkCopy) |
3674 |
3678 |
3675 "Modified (comment): / 13-03-2019 / 17:03:47 / Stefan Vogel" |
3679 "Modified: / 13-03-2019 / 23:06:37 / Stefan Vogel" |
3676 ! |
3680 ! |
3677 |
3681 |
3678 copy:numberOfElementsOrNil into:aWriteStream bufferSize:bufferSizeArg |
3682 copy:numberOfElementsOrNil into:aWriteStream bufferSize:bufferSizeArg |
3679 "read from the receiver, and write numberOfElementsOrNil elements to outStream, a WriteStream. |
3683 "read from the receiver, and write numberOfElementsOrNil elements to outStream, a WriteStream. |
3680 Return the number of elements which have been transferred. |
3684 Return the number of elements which have been transferred. |
3768 |
3772 |
3769 copyToEndInto:outStream |
3773 copyToEndInto:outStream |
3770 "read from the receiver, and write all elements up to the end to outStream, a WriteStream. |
3774 "read from the receiver, and write all elements up to the end to outStream, a WriteStream. |
3771 Return the number of elements which have been transferred" |
3775 Return the number of elements which have been transferred" |
3772 |
3776 |
3773 ^ self copy:nil into:outStream bufferSize:(self class bufferSizeForBulkCopy) |
3777 ^ self copy:nil into:outStream bufferSize:(outStream class bufferSizeForBulkCopy) |
3774 |
3778 |
3775 "/ data rate to USB2.0 stick (Win32): |
3779 "/ data rate to USB2.0 stick (Win32): |
3776 "/ 120 KB/s 8Kb SingleBuffer |
3780 "/ 120 KB/s 8Kb SingleBuffer |
3777 "/ 741 KB/s 64Kb SingleBuffer |
3781 "/ 741 KB/s 64Kb SingleBuffer |
3778 "/ 1345 KB/s 128Kb SingleBuffer |
3782 "/ 1345 KB/s 128Kb SingleBuffer |
3790 "/ with:((t/1000)asFixedPoint:2) |
3794 "/ with:((t/1000)asFixedPoint:2) |
3791 "/ with:((retVal/1024/(t/1000))asFixedPoint:2)). |
3795 "/ with:((retVal/1024/(t/1000))asFixedPoint:2)). |
3792 "/^ retVal. |
3796 "/^ retVal. |
3793 "/ |
3797 "/ |
3794 |
3798 |
3795 "Modified (comment): / 13-03-2019 / 17:03:04 / Stefan Vogel" |
3799 "Modified: / 13-03-2019 / 23:06:44 / Stefan Vogel" |
3796 ! |
3800 ! |
3797 |
3801 |
3798 copyToEndInto:outStream bufferSize:bufferSize |
3802 copyToEndInto:outStream bufferSize:bufferSize |
3799 "read from the receiver, and write all elements up to the end to outStream, aWriteStream. |
3803 "read from the receiver, and write all elements up to the end to outStream, aWriteStream. |
3800 Return the number of elements which have been transferred" |
3804 Return the number of elements which have been transferred" |