Examples of mark()


Examples of java.nio.Buffer.mark()

  {
    Buffer buf = null;

    // mark at default position
    buf = factory.newInstance();
    h.check(buf.mark(), buf, "mark: buf.mark()");
    checkStatus(h, buf, "mark", 10, 10, true, 10, 0);
    buf.position(5);
    checkStatus(h, buf, "mark", 10, 10, true, 5, 5);
    h.check(buf.reset(), buf, "mark: buf.reset()");
    checkStatus(h, buf, "mark", 10, 10, true, 10, 0);
View Full Code Here

Examples of java.nio.ByteBuffer.mark()

    final ByteBuffer view = BufferUtils.duplicate(buffer);
    final int capacity = view.capacity();
    boolean status = true;

    for (int i = 0; i < count && view.position() + MAX_HEADER_LENGTH < capacity; i++) {
      view.mark();
      long length = headerReader.readLength(view);
      int p = view.position() + (int) length;

      if (pattern.match(view) == false) {
        status = false;
View Full Code Here

Examples of java.nio.ByteBuffer.mark()

            }
            receiver=new Receiver(sock, channel, matrix, jg);
            receiver.start();

            ByteBuffer bb=ByteBuffer.allocate(16);
            bb.mark();

            start=System.currentTimeMillis();
            for(int i=0; i < num_msgs; i++) {
                bb.reset();
                bb.putInt(i);
View Full Code Here

Examples of java.nio.ByteBuffer.mark()

            Message msg;
            byte[] msg_data=null;
            long total_time;
            double msgs_per_sec=0;
            ByteBuffer rb=ByteBuffer.allocate(16);
            rb.mark();

            packet=new DatagramPacket(buf, buf.length);
            while(num_received <= num_msgs) {
                try {
                    if(jg) {
View Full Code Here

Examples of java.nio.CharBuffer.mark()

        // encode all the characters that fit into the output byte buffer
        boolean done = false;
        byte[] bytes = new byte[width];
        while (!done) {
            int begin = allChars.position();
            allChars.mark();
            ByteBuffer byteBuffer = ByteBuffer.wrap(bytes);
            CoderResult coderResult = encoder.encode(allChars, byteBuffer, false);
            int end = allChars.position();
            int length = end - begin;
            if (length == 0) {
View Full Code Here

Examples of java.nio.IntBuffer.mark()

        @Override
        public long test(BufferedImage image, int iterations) {
            final IntBuffer sumIntegralImage = IntBuffer.allocate((image.getWidth() + 1) * (image.getHeight() + 1));
            final LongBuffer sumSQIntegralImage = LongBuffer.allocate(sumIntegralImage.capacity());

            sumIntegralImage.mark();
            sumSQIntegralImage.mark();

            startTimer();
            for (int i = 0; i < iterations; i++) {
                sumIntegralImage.reset();
View Full Code Here

Examples of java.nio.LongBuffer.mark()

        public long test(BufferedImage image, int iterations) {
            final IntBuffer sumIntegralImage = IntBuffer.allocate((image.getWidth() + 1) * (image.getHeight() + 1));
            final LongBuffer sumSQIntegralImage = LongBuffer.allocate(sumIntegralImage.capacity());

            sumIntegralImage.mark();
            sumSQIntegralImage.mark();

            startTimer();
            for (int i = 0; i < iterations; i++) {
                sumIntegralImage.reset();
                sumSQIntegralImage.reset();
View Full Code Here

Examples of java.util.zip.DeflaterInputStream.mark()

     * @tests DeflaterInputStream#mark()
     */
    public void testMark() throws IOException {
        // mark do nothing
        DeflaterInputStream dis = new DeflaterInputStream(is);
        dis.mark(-1);
        dis.mark(0);
        dis.mark(1);
        dis.close();
        dis.mark(1);
    }
View Full Code Here

Examples of java.util.zip.InflaterInputStream.mark()

     */
    public void test_markI() {
        InputStream is = new ByteArrayInputStream(new byte[10]);
        InflaterInputStream iis = new InflaterInputStream(is);
        // mark do nothing, do no check
        iis.mark(0);
        iis.mark(-1);
        iis.mark(10000000);
    }

    /**
 
View Full Code Here

Examples of javax.imageio.stream.FileImageInputStream.mark()

            try {

                // Checking Magic Number
                fis = new FileImageInputStream(input);
                byte[] b = new byte[4];
                fis.mark();
                fis.readFully(b);
                fis.reset();
                boolean cdfCheck = (b[0] == (byte)0x43 && b[1] == (byte)0x44 && b[2] == (byte)0x46);
                boolean hdf5Check = (b[0] == (byte)0x89 && b[1] == (byte)0x48 && b[2] == (byte)0x44);
                boolean gribCheck = (b[0] == (byte)0x47 && b[1] == (byte)0x52 && b[2] == (byte)0x49 && b[3] == (byte)0x42);
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.