File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
msgpack-core/src/main/java/org/msgpack/core/buffer Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -31,19 +31,19 @@ public class ByteBufferInput
3131
3232 public ByteBufferInput (ByteBuffer input )
3333 {
34- this .input = checkNotNull (input , "input ByteBuffer is null" );
34+ this .input = checkNotNull (input , "input ByteBuffer is null" ). slice () ;
3535 }
3636
3737 /**
38- * Reset buffer. This method doesn't close the old resource.
38+ * Reset buffer.
3939 *
4040 * @param input new buffer
41- * @return the old resource
41+ * @return the old buffer
4242 */
4343 public ByteBuffer reset (ByteBuffer input )
4444 {
4545 ByteBuffer old = this .input ;
46- this .input = input ;
46+ this .input = checkNotNull ( input , "input ByteBuffer is null" ). slice () ;
4747 isRead = false ;
4848 return old ;
4949 }
@@ -55,8 +55,9 @@ public MessageBuffer next()
5555 return null ;
5656 }
5757
58+ MessageBuffer b = MessageBuffer .wrap (input );
5859 isRead = true ;
59- return MessageBuffer . wrap ( input ) ;
60+ return b ;
6061 }
6162
6263 @ Override
You can’t perform that action at this time.
0 commit comments