File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/ssl Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -81,10 +81,13 @@ public ByteBuffer getBufferForReading() {
81
81
82
82
/**
83
83
* Update read position from a buffer previously obtained using {@link #getBufferForReading()}
84
+ * The caller is responsible for making sure the buffer was obtained for this BIO, that this BIO
85
+ * was not concurrently updated since the {@link #getBufferForReading()} call and that the
86
+ * position was not moved backwards.
84
87
*/
85
88
public void applyRead (ByteBuffer buffer ) {
86
89
readPosition = buffer .position ();
87
- assert readPosition <= bytes . length ;
90
+ assert buffer . array () == bytes ;
88
91
assert readPosition <= writePosition ;
89
92
}
90
93
@@ -100,11 +103,14 @@ public ByteBuffer getBufferForWriting() {
100
103
}
101
104
102
105
/**
103
- * Update write position from a buffer previously obtained using {@link #getBufferForWriting()}
106
+ * Update write position from a buffer previously obtained using {@link #getBufferForWriting()}.
107
+ * The caller is responsible for making sure the buffer was obtained for this BIO, that this BIO
108
+ * was not concurrently updated since the {@link #getBufferForWriting()} call and that the
109
+ * position was not moved backwards.
104
110
*/
105
111
public void applyWrite (ByteBuffer buffer ) {
106
112
writePosition = buffer .position ();
107
- assert writePosition <= bytes . length ;
113
+ assert buffer . array () == bytes ;
108
114
assert readPosition <= writePosition ;
109
115
}
110
116
You can’t perform that action at this time.
0 commit comments