Package org.vertx.java.core.buffer

Examples of org.vertx.java.core.buffer.Buffer.appendByte()


                pos += 2;
            } else if (startsWith(value, pos, NEWLINE_ESCAPE_SEQ.toBuffer())) {
                rc.appendByte(NEWLINE_BYTE);
                pos += 2;
            } else {
                rc.appendByte(value.getByte(pos));
                pos += 1;
            }
        }
        return rc.toString();
    }
View Full Code Here


                        break;
                    case NEWLINE_BYTE:
                        rc.appendBuffer(COLON_ESCAPE_SEQ.toBuffer());
                        break;
                    default:
                        rc.appendByte(d);
                }
            }
            return ascii(rc);
        } catch (UnsupportedEncodingException e) {
            throw new RuntimeException(e); // not expected.
View Full Code Here

    int length = 1 + 1 + 4 + address.length() + 1 + 4 * sender.host.length() +
        4 + (replyAddress == null ? 0 : replyAddress.length()) +
        getBodyLength();
    Buffer totBuff = new Buffer(length);
    totBuff.appendInt(0);
    totBuff.appendByte(type());
    totBuff.appendByte(send ? (byte)0 : (byte)1);
    writeString(totBuff, address);
    totBuff.appendInt(sender.port);
    writeString(totBuff, sender.host);
    if (replyAddress != null) {
View Full Code Here

        4 + (replyAddress == null ? 0 : replyAddress.length()) +
        getBodyLength();
    Buffer totBuff = new Buffer(length);
    totBuff.appendInt(0);
    totBuff.appendByte(type());
    totBuff.appendByte(send ? (byte)0 : (byte)1);
    writeString(totBuff, address);
    totBuff.appendInt(sender.port);
    writeString(totBuff, sender.host);
    if (replyAddress != null) {
      writeString(totBuff, replyAddress);
View Full Code Here

        Buffer h = new Buffer(2);
        h.appendString("h\n");

        Buffer hs = new Buffer(2050);
        for (int i = 0; i < 2048; i++) {
          hs.appendByte((byte) ' ');
        }
        hs.appendString("h\n");

        List<TimeoutInfo> timeouts = new ArrayList<>();
View Full Code Here

              n = 1;
            }
            int num = (int)Math.pow(2, n);
            Buffer buff = new Buffer(num);
            for (int i = 0; i < num; i++) {
              buff.appendByte((byte)'x');
            }
            sock.write(buff);
          }
        });
      }
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.