Package java.nio

Examples of java.nio.MappedByteBuffer.rewind()


                //System.out.println("input = " + input);
                if(input == 0) {
                    // write
                    byte[] buf=new byte[SIZE];
                    shared_buffer.put(buf, 0, buf.length);
                    shared_buffer.rewind();
                    shared_buffer.put((byte)1).rewind();
                    count++;
                    if(count % PRINT == 0)
                        System.out.println("wrote " + count);
                }
View Full Code Here


                //System.out.println("input = " + input);
                if(input == 1) {
                    // write
                    byte[] buf=new byte[SIZE];
                    shared_buffer.get(buf,0,buf.length);
                    shared_buffer.rewind();
                    shared_buffer.put((byte)0).rewind();
                    count++;
                    if(count % PRINT == 0)
                        System.out.println("read " + count);
                }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.