Skip to content

Commit ed9153d

Browse files
author
Patrik
committed
Adding a needed method for SocketStream in GemStone
1 parent eeafe13 commit ed9153d

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
*grease-gemstone-core
2+
greaseNext: anInteger putAll: aCollection startingAt: startIndex
3+
"Put a String or a ByteArray onto the stream starting at the given position.
4+
Currently a large collection will allocate a large buffer."
5+
6+
| toPut |
7+
anInteger = 0 ifTrue: [
8+
^ aCollection ].
9+
toPut := binary ifTrue: [ aCollection asByteArray ] ifFalse: [ aCollection asString ].
10+
self adjustOutBuffer: anInteger.
11+
outBuffer replaceFrom: outNextToWrite to: outNextToWrite + anInteger - 1 with: toPut startingAt: startIndex.
12+
outNextToWrite := outNextToWrite + anInteger.
13+
self checkFlush
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"name" : "SocketStream"
3+
}

0 commit comments

Comments
 (0)