Examples of ByteSequence


Examples of org.apache.james.mime4j.util.ByteSequence

            int usedCharacters = name.length() + 2;
            String fieldValue =
                    EncoderUtil.encodeIfNecessary(value,
                            EncoderUtil.Usage.TEXT_TOKEN, usedCharacters);
            String rawStr = MimeUtil.fold(name + ": " + fieldValue, 0);
            ByteSequence raw = ContentUtil.encode(rawStr);
            return mime4jFieldParser.parse(name, fieldValue, raw);
        }
View Full Code Here

Examples of org.apache.kahadb.util.ByteSequence

        }

    }

    synchronized ByteSequence getPayload(Location location) throws IllegalStateException, IOException {
        ByteSequence result = null;
        result = this.journal.read(location);
        return result;
    }
View Full Code Here

Examples of org.apache.tomcat.util.bcel.util.ByteSequence

     * @return String representation of byte codes
     */
    public static final String codeToString( byte[] code, ConstantPool constant_pool, int index,
            int length, boolean verbose ) {
        StringBuilder buf = new StringBuilder(code.length * 20); // Should be sufficient
        ByteSequence stream = new ByteSequence(code);
        try {
            for (int i = 0; i < index; i++) {
                codeToString(stream, constant_pool, verbose);
            }
            for (int i = 0; stream.available() > 0; i++) {
                if ((length < 0) || (i < length)) {
                    String indices = fillup(stream.getIndex() + ":", 6, true, ' ');
                    buf.append(indices).append(codeToString(stream, constant_pool, verbose))
                            .append('\n');
                }
            }
        } catch (IOException e) {
View Full Code Here

Examples of org.apache.tomcat.util.bcel.util.ByteSequence

     * @return String representation of byte codes
     */
    public static final String codeToString( byte[] code, ConstantPool constant_pool, int index,
            int length, boolean verbose ) {
        StringBuffer buf = new StringBuffer(code.length * 20); // Should be sufficient
        ByteSequence stream = new ByteSequence(code);
        try {
            for (int i = 0; i < index; i++) {
                codeToString(stream, constant_pool, verbose);
            }
            for (int i = 0; stream.available() > 0; i++) {
                if ((length < 0) || (i < length)) {
                    String indices = fillup(stream.getIndex() + ":", 6, true, ' ');
                    buf.append(indices).append(codeToString(stream, constant_pool, verbose))
                            .append('\n');
                }
            }
        } catch (IOException e) {
View Full Code Here

Examples of org.aspectj.apache.bcel.util.ByteSequence

   * Initialize instruction list from byte array.
   *
   * @param code byte array containing the instructions
   */
  public InstructionList(byte[] code) {
    ByteSequence bytes = new ByteSequence(code);
    InstructionHandle[] ihs = new InstructionHandle[code.length];
    int[] pos = new int[code.length]; // Can't be more than that
    int count = 0; // Contains actual length

    /*
     * Pass 1: Create an object for each byte code and append them to the list.
     */
    try {
      while (bytes.available() > 0) {
        // Remember byte offset and associate it with the instruction
        int off = bytes.getIndex();
        pos[count] = off;

        /*
         * Read one instruction from the byte stream, the byte position is set accordingly.
         */
 
View Full Code Here

Examples of org.aspectj.apache.bcel.util.ByteSequence

  /**
   * @return an array of instructions without target information for branch instructions.
   */
  public Instruction[] getInstructions() {
    ByteSequence bytes = new ByteSequence(getByteCode());
    ArrayList<Instruction> instructions = new ArrayList<Instruction>();

    try {
      while (bytes.available() > 0) {
        instructions.add(Instruction.readInstruction(bytes));
      }
    } catch (IOException e) {
      throw new ClassGenException(e.toString());
    }
View Full Code Here

Examples of org.elasticsearch.hadoop.util.ByteSequence

            SimpleRequest routedRequest = new SimpleRequest(request.method(), null, request.path(), request.params(), request.body());

            newNode = false;
            try {
                response = currentTransport.execute(routedRequest);
                ByteSequence body = routedRequest.body();
                if (body != null) {
                    stats.bytesSent += body.length();
                }
            } catch (Exception ex) {
                if (log.isTraceEnabled()) {
                    log.trace(
                            String.format(
View Full Code Here

Examples of org.elasticsearch.hadoop.util.ByteSequence

        CharSequence params = request.params();
        if (StringUtils.hasText(params)) {
            http.setQueryString(params.toString());
        }

        ByteSequence ba = request.body();
        if (ba != null && ba.length() > 0) {
            EntityEnclosingMethod entityMethod = (EntityEnclosingMethod) http;
            entityMethod.setRequestEntity(new BytesArrayRequestEntity(ba));
            entityMethod.setContentChunked(false);
        }
View Full Code Here

Examples of org.nasutekds.server.types.ByteSequence

        {
          closingBracePos = i;
          break;
        }
      }
      ByteSequence seq1 = value.subSequence(0, closingBracePos + 1);
      ByteSequence seq2 =
        value.subSequence(closingBracePos + 1, value.length());
      StaticUtils.toLowerCase(seq1, builder, false);
      builder.append(seq2);
      return ByteString.valueOf(builder.toString());
    }
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.