Package net.sf.cindy

Examples of net.sf.cindy.Buffer.skip()


        }
    }

    public void testSkip() {
        Buffer buffer = newBuffer(random.nextInt(100) + 10);
        buffer.skip(1);
        assertEquals(buffer.position(), 1);
        buffer.skip(2);
        assertEquals(buffer.position(), 3);
        buffer.skip(buffer.remaining());
        assertEquals(buffer.position(), buffer.limit());
View Full Code Here


    public void testSkip() {
        Buffer buffer = newBuffer(random.nextInt(100) + 10);
        buffer.skip(1);
        assertEquals(buffer.position(), 1);
        buffer.skip(2);
        assertEquals(buffer.position(), 3);
        buffer.skip(buffer.remaining());
        assertEquals(buffer.position(), buffer.limit());
    }
View Full Code Here

        Buffer buffer = newBuffer(random.nextInt(100) + 10);
        buffer.skip(1);
        assertEquals(buffer.position(), 1);
        buffer.skip(2);
        assertEquals(buffer.position(), 3);
        buffer.skip(buffer.remaining());
        assertEquals(buffer.position(), buffer.limit());
    }

    public void testIndexOf() {
        Buffer buffer = newBuffer(256);
View Full Code Here

            Buffer buffer = packet.getContent();
            int index = buffer.indexOf(TOKEN);
            if (index >= 0) {
                String s = buffer.getString(Charset.SYSTEM, index
                        - buffer.position());
                buffer.skip(TOKEN.length);
                return s;
            }
            return null;
        }
    }
View Full Code Here

                if (packet.getAddress() == null) // connected
                    writeCount = buffer.write(channel);
                else {
                    writeCount = channel.send(buffer.asByteBuffer(), packet
                            .getAddress());
                    buffer.skip(writeCount);
                }
                return writeCount != 0;
            }

        };
View Full Code Here

        if (buffer.remaining() < 4)
            return null;

        if (buffer.getShort() == ObjectStreamConstants.STREAM_MAGIC
                && buffer.getShort() == ObjectStreamConstants.STREAM_VERSION) {
            buffer.skip(-4);

            ObjectInputStream is = null;
            try {
                is = new ObjectInputStream(new InputStream() {
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.