Examples of arrayOffset()


Examples of java.nio.ByteBuffer.arrayOffset()

    protected byte[] getBytes(String name) throws ZipException {
        try {
            ByteBuffer b =
                ZipEncodingHelper.getZipEncoding(encoding).encode(name);
            byte[] result = new byte[b.limit()];
            System.arraycopy(b.array(), b.arrayOffset(), result, 0,
                             result.length);
            return result;
        } catch (IOException ex) {
            throw new ZipException("Failed to encode name: " + ex.getMessage());
        }
View Full Code Here

Examples of java.nio.ByteBuffer.arrayOffset()

        byte[] extra = ze.getLocalFileDataExtra();
        writeOut(ZipShort.getBytes(extra.length));
        written += SHORT;

        // file name
        writeOut(name.array(), name.arrayOffset(),
                 name.limit() - name.position());
        written += name.limit();

        // extra field
        writeOut(extra);
View Full Code Here

Examples of java.nio.ByteBuffer.arrayOffset()

            if (createUnicodeExtraFields == UnicodeExtraFieldPolicy.ALWAYS
                || !commentEncodable) {
                ByteBuffer commentB = getEntryEncoding(ze).encode(comm);
                ze.addExtraField(new UnicodeCommentExtraField(comm,
                                                              commentB.array(),
                                                              commentB.arrayOffset(),
                                                              commentB.limit()
                                                              - commentB.position())
                                 );
            }
        }
View Full Code Here

Examples of java.nio.ByteBuffer.arrayOffset()

        // extra field
        writeOut(extra);
        written += extra.length;

        // file comment
        writeOut(commentB.array(), commentB.arrayOffset(),
                 commentB.limit() - commentB.position());
        written += commentB.limit();
    }

    /**
 
View Full Code Here

Examples of java.nio.ByteBuffer.arrayOffset()

    } else {
      baseRevision = ByteBuffer.allocate(rr.getDataLength());
      rr.getData(baseRevision);
      baseRevision.flip();
    }
    ByteArrayDataAccess baseRevisionContent = new ByteArrayDataAccess(baseRevision.array(), baseRevision.arrayOffset(), baseRevision.remaining());
    //
    final long start = System.currentTimeMillis();
    int n = 1419;
    Patch seqPatch = new Patch(false), normalizedPatch = new Patch(true);
    while (rr.hasMore() && n-- > 0) {
View Full Code Here

Examples of java.nio.ByteBuffer.arrayOffset()

            assert key != null && cf != null;
           
            // and wrap it in a tuple
          Tuple tuple = TupleFactory.getInstance().newTuple(2);
            ArrayList<Tuple> columns = new ArrayList<Tuple>();
            tuple.set(0, new DataByteArray(key.array(), key.position()+key.arrayOffset(), key.limit()+key.arrayOffset()));
            for (Map.Entry<ByteBuffer, IColumn> entry : cf.entrySet())
            {
                columns.add(columnToTuple(entry.getKey(), entry.getValue(), cfDef));
            }
View Full Code Here

Examples of java.nio.ByteBuffer.arrayOffset()

            assert key != null && cf != null;
           
            // and wrap it in a tuple
          Tuple tuple = TupleFactory.getInstance().newTuple(2);
            ArrayList<Tuple> columns = new ArrayList<Tuple>();
            tuple.set(0, new DataByteArray(key.array(), key.position()+key.arrayOffset(), key.limit()+key.arrayOffset()));
            for (Map.Entry<ByteBuffer, IColumn> entry : cf.entrySet())
            {
                columns.add(columnToTuple(entry.getKey(), entry.getValue(), cfDef));
            }
View Full Code Here

Examples of java.nio.ByteBuffer.arrayOffset()

            }
            partialCrc = null;
          } else {
            lastChunkChecksum = Arrays.copyOfRange(
                checksumBuf.array(),
                checksumBuf.arrayOffset() + checksumBuf.position() + checksumLen - checksumSize,
                checksumBuf.arrayOffset() + checksumBuf.position() + checksumLen);
            checksumOut.write(checksumBuf.array(),
                checksumBuf.arrayOffset() + checksumBuf.position(),
                checksumLen);
          }
View Full Code Here

Examples of java.nio.ByteBuffer.arrayOffset()

            partialCrc = null;
          } else {
            lastChunkChecksum = Arrays.copyOfRange(
                checksumBuf.array(),
                checksumBuf.arrayOffset() + checksumBuf.position() + checksumLen - checksumSize,
                checksumBuf.arrayOffset() + checksumBuf.position() + checksumLen);
            checksumOut.write(checksumBuf.array(),
                checksumBuf.arrayOffset() + checksumBuf.position(),
                checksumLen);
          }
          /// flush entire packet, sync if requested
View Full Code Here

Examples of java.nio.ByteBuffer.arrayOffset()

            lastChunkChecksum = Arrays.copyOfRange(
                checksumBuf.array(),
                checksumBuf.arrayOffset() + checksumBuf.position() + checksumLen - checksumSize,
                checksumBuf.arrayOffset() + checksumBuf.position() + checksumLen);
            checksumOut.write(checksumBuf.array(),
                checksumBuf.arrayOffset() + checksumBuf.position(),
                checksumLen);
          }
          /// flush entire packet, sync if requested
          flushOrSync(syncBlock);
         
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.