File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
src/main/kotlin/uno/buffer Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,30 @@ fun ByteBuffer.use(block: (ByteBuffer) -> Unit) {
8080 block(this )
8181 destroy()
8282}
83+ fun ShortBuffer.use (block : (ShortBuffer ) -> Unit ) {
84+ block(this )
85+ destroy()
86+ }
87+ fun IntBuffer.use (block : (IntBuffer ) -> Unit ) {
88+ block(this )
89+ destroy()
90+ }
91+ fun LongBuffer.use (block : (LongBuffer ) -> Unit ) {
92+ block(this )
93+ destroy()
94+ }
95+ fun FloatBuffer.use (block : (FloatBuffer ) -> Unit ) {
96+ block(this )
97+ destroy()
98+ }
99+ fun DoubleBuffer.use (block : (DoubleBuffer ) -> Unit ) {
100+ block(this )
101+ destroy()
102+ }
103+ fun CharBuffer.use (block : (CharBuffer ) -> Unit ) {
104+ block(this )
105+ destroy()
106+ }
83107
84108@Suppress(" UNCHECKED_CAST" )
85109fun withBuffer (list : List <* >, block : ByteBuffer .() -> Unit ) {
You can’t perform that action at this time.
0 commit comments