Buffer.<init>
Code IndexAdd Codota to your IDE (free)

Best code snippets using org.fusesource.hawtbuf.Buffer.<init>(Showing top 15 results out of 315)

  • Common ways to obtain Buffer
private void myMethod () {
Buffer b =
  • DataByteArrayOutputStream dataByteArrayOutputStream;dataByteArrayOutputStream.toBuffer()
  • new Buffer(data)
  • new Buffer(size)
  • Smart code suggestions by Codota
}
origin: org.apache.activemq/activemq-all

public Buffer getNextBuffer(int len) throws IOException {
  int newPos = pos + len;
  checkCapacity(newPos);
  return new Buffer(buffer, pos, len);
}

origin: org.apache.activemq/activemq-all

public Buffer decode(DataInput dataIn) throws IOException {
  byte[] data = new byte[size];
  dataIn.readFully(data);
  return new Buffer(data);
}
origin: apache/activemq-artemis

/**
* Given a long value, convert it to a byte array for marshalling.
*
* @param value the value to convert.
* @return a new byte array that holds the big endian value of the long.
*/
public static byte[] toBytes(long value) {
 Buffer buffer = new Buffer(8);
 buffer.bigEndianEditor().writeLong(value);
 return buffer.data;
}
origin: org.fusesource.stompjms/stompjms-client

private void initializeReading() throws MessageNotReadableException {
  checkWriteOnlyBody();
  if (this.dataIn == null) {
    Buffer buffer = getContent();
    if (buffer == null) {
      buffer = new Buffer(new byte[]{}, 0, 0);
    }
    this.dataIn = new DataInputStream(new ByteArrayInputStream(buffer));
  }
}
origin: org.fusesource.stompjms/stompjms-client

private void initializeReading() throws JMSException {
  checkWriteOnlyBody();
  if (dataIn == null) {
    Buffer buffer = getContent();
    if (buffer==null) {
      buffer = new Buffer(0);
    }
    dataIn = new DataInputStream(new ByteArrayInputStream(buffer));
    this.length = buffer.getLength();
  }
}
origin: org.apache.activemq/activemq-all

public Buffer readBuffer(int len) {
  Buffer rc=null;
  if (pos < limit) {
    len = Math.min(len, limit - pos);
    rc = new Buffer(buffer, pos, len);
    pos += len;
  }
  return rc;
}
origin: org.apache.activemq/activemq-all

  @Override
  public void reset(int nextExpectedReadSize) {
    // Allocate a new Buffer to hold the incoming frame.  We must write
    // back the frame size value before continue on to read the indicated
    // frame size minus the size of the AMQP frame size header value.
    frame = new Buffer(nextExpectedReadSize);
    frame.bigEndianEditor().writeInt(nextExpectedReadSize);
    // Reset the length to total length as we do direct write after this.
    frame.length = frame.data.length;
  }
};
origin: fusesource/mqtt-client

static private  String hex(SocketAddress address) {
  if( address instanceof InetSocketAddress ) {
    InetSocketAddress isa = (InetSocketAddress)address;
    return HexSupport.toHexFromBuffer(new Buffer(isa.getAddress().getAddress()))+Integer.toHexString(isa.getPort());
  }
  return "";
}
origin: org.apache.activemq/activemq-all

final public Buffer compact() {
  if (length != data.length) {
    return new Buffer(toByteArray());
  }
  return this;
}
origin: org.apache.activemq/activemq-all

public Buffer readBuffer(int len) {
  int endpos = offset + length;
  if (pos > endpos) {
    return null;
  }
  if (pos + len > endpos) {
    len = length - pos;
  }
  Buffer rc = new Buffer(buf, pos, len);
  pos += len;
  return rc;
}
origin: org.fusesource.hawtbuf/hawtbuf

  @Override
  protected Buffer createBuffer(byte[] data) {
    return new Buffer(data);
  }
}
origin: org.apache.activemq/activemq-osgi

public Buffer decode(DataInput dataIn) throws IOException {
  byte[] data = new byte[size];
  dataIn.readFully(data);
  return new Buffer(data);
}
origin: org.apache.activemq/activemq-all

final public Buffer trimEnd() {
  byte data[] = this.data;
  int offset = this.offset;
  int length = this.length;
  int end = offset+this.length-1;
  int pos = end;
  
  while ((offset <= pos) && (data[pos] <= ' ')) {
    pos--;
  }
  return (pos == end) ? this : new Buffer(data, offset, (length-(end-pos))); 
}
origin: org.apache.activemq/activemq-all

/**
 * Get a Buffer from the stream
 * 
 * @return the byte sequence
 */
public Buffer toBuffer() {
  return new Buffer(buf, 0, pos);
}
origin: org.apache.activemq/activemq-all

final public Buffer trimFront() {
  byte data[] = this.data;
  int offset = this.offset;
  int end = offset+this.length;
  int pos = offset;
  while ((pos < end) && (data[pos] <= ' ')) {
    pos++;
  }
  return (pos == offset) ? this : new Buffer(data, pos, (length-(pos-offset))); 
}
org.fusesource.hawtbufBuffer<init>

Popular methods of Buffer

  • toByteArray
  • getLength
  • length
  • getData
  • getOffset
  • deepCopy
  • equals
  • startsWith
  • utf8
  • writeTo
    same as out.write(data, offset, length);
  • ascii
  • get
  • ascii,
  • get,
  • hashCode,
  • indexOf,
  • bigEndianEditor,
  • buffer,
  • moveHead,
  • reset,
  • clear

Popular classes and methods

  • setContentView (Activity)
  • getApplicationContext (Context)
  • addToBackStack (FragmentTransaction)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • URI (java.net)
    Represents a Uniform Resource Identifier (URI) reference. Aside from some minor deviations noted bel
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • ResultSet (java.sql)
    A table of data representing a database result set, which is usually generated by executing a statem
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • JOptionPane (javax.swing)

For IntelliJ IDEA,
Android Studio or Eclipse

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)