Tabnine Logo
ByteChunk.allocate
Code IndexAdd Tabnine to your IDE (free)

How to use
allocate
method
in
org.glassfish.grizzly.http.util.ByteChunk

Best Java code snippets using org.glassfish.grizzly.http.util.ByteChunk.allocate (Showing top 20 results out of 315)

origin: org.glassfish.grizzly/grizzly-websockets-server

public ByteChunk( int initial ) {
  allocate( initial, -1 );
}
origin: javaee/grizzly

public ByteChunk( int initial ) {
  allocate( initial, -1 );
}
origin: javaee/grizzly

public ByteChunk( int initial ) {
  allocate( initial, -1 );
}
origin: org.glassfish.grizzly/grizzly-http-server-core

public ByteChunk( int initial ) {
  allocate( initial, -1 );
}
origin: org.glassfish.grizzly/grizzly-http

public ByteChunk( int initial ) {
  allocate( initial, -1 );
}
origin: javaee/grizzly

public ByteChunk( int initial ) {
  allocate( initial, -1 );
}
origin: javaee/grizzly

public ByteChunk( int initial ) {
  allocate( initial, -1 );
}
origin: javaee/grizzly

public ByteChunk( int initial ) {
  allocate( initial, -1 );
}
origin: javaee/grizzly

public ByteChunk( int initial ) {
  allocate( initial, -1 );
}
origin: javaee/grizzly

public ByteChunk( int initial ) {
  allocate( initial, -1 );
}
origin: javaee/grizzly

/** Convert a message bytes chars to bytes
 */
public void convert(MessageBytes mb ) throws IOException {
  int type=mb.getType();
  if( type==MessageBytes.T_BYTES )
    return;
  ByteChunk orig=bb;
  setByteChunk( mb.getByteChunk());
  bb.recycle();
  bb.allocate( 32, -1 );
  if( type==MessageBytes.T_STR ) {
    convert( mb.getString() );
    // System.out.println("XXX Converting " + mb.getString() );
  } else if( type==MessageBytes.T_CHARS ) {
    CharChunk charC=mb.getCharChunk();
    convert( charC.getBuffer(),
              charC.getStart(), charC.getLength());
    //System.out.println("XXX Converting " + mb.getCharChunk() );
  } else {
    if (logger.isLoggable(Level.FINE)){
      logger.log(Level.FINE, "XXX unknowon type {0}", type);
    }
  }
  //System.out.println("C2B: XXX " + bb.getBuffer() + bb.getLength());
  setByteChunk(orig);
}
origin: javaee/grizzly

/** Convert a message bytes chars to bytes
 */
public void convert(MessageBytes mb ) throws IOException {
  int type=mb.getType();
  if( type==MessageBytes.T_BYTES )
    return;
  ByteChunk orig=bb;
  setByteChunk( mb.getByteChunk());
  bb.recycle();
  bb.allocate( 32, -1 );
  if( type==MessageBytes.T_STR ) {
    convert( mb.getString() );
    // System.out.println("XXX Converting " + mb.getString() );
  } else if( type==MessageBytes.T_CHARS ) {
    CharChunk charC=mb.getCharChunk();
    convert( charC.getBuffer(),
              charC.getStart(), charC.getLength());
    //System.out.println("XXX Converting " + mb.getCharChunk() );
  } else {
    if (logger.isLoggable(Level.FINE)){
      logger.log(Level.FINE, "XXX unknowon type {0}", type);
    }
  }
  //System.out.println("C2B: XXX " + bb.getBuffer() + bb.getLength());
  setByteChunk(orig);
}
origin: javaee/grizzly

/** Convert a message bytes chars to bytes
 */
public void convert(MessageBytes mb ) throws IOException {
  int type=mb.getType();
  if( type==MessageBytes.T_BYTES )
    return;
  ByteChunk orig=bb;
  setByteChunk( mb.getByteChunk());
  bb.recycle();
  bb.allocate( 32, -1 );
  if( type==MessageBytes.T_STR ) {
    convert( mb.getString() );
    // System.out.println("XXX Converting " + mb.getString() );
  } else if( type==MessageBytes.T_CHARS ) {
    CharChunk charC=mb.getCharChunk();
    convert( charC.getBuffer(),
              charC.getStart(), charC.getLength());
    //System.out.println("XXX Converting " + mb.getCharChunk() );
  } else {
    if (logger.isLoggable(Level.FINE)){
      logger.log(Level.FINE, "XXX unknowon type {0}", type);
    }
  }
  //System.out.println("C2B: XXX " + bb.getBuffer() + bb.getLength());
  setByteChunk(orig);
}
origin: org.glassfish.grizzly/grizzly-http

/** Convert a message bytes chars to bytes
 */
public void convert(MessageBytes mb ) throws IOException {
  int type=mb.getType();
  if( type==MessageBytes.T_BYTES )
    return;
  ByteChunk orig=bb;
  setByteChunk( mb.getByteChunk());
  bb.recycle();
  bb.allocate( 32, -1 );
  if( type==MessageBytes.T_STR ) {
    convert( mb.getString() );
    // System.out.println("XXX Converting " + mb.getString() );
  } else if( type==MessageBytes.T_CHARS ) {
    CharChunk charC=mb.getCharChunk();
    convert( charC.getBuffer(),
              charC.getStart(), charC.getLength());
    //System.out.println("XXX Converting " + mb.getCharChunk() );
  } else {
    if (logger.isLoggable(Level.FINE)){
      logger.log(Level.FINE, "XXX unknowon type {0}", type);
    }
  }
  //System.out.println("C2B: XXX " + bb.getBuffer() + bb.getLength());
  setByteChunk(orig);
}
origin: javaee/grizzly

/** Convert a message bytes chars to bytes
 */
public void convert(MessageBytes mb ) throws IOException {
  int type=mb.getType();
  if( type==MessageBytes.T_BYTES )
    return;
  ByteChunk orig=bb;
  setByteChunk( mb.getByteChunk());
  bb.recycle();
  bb.allocate( 32, -1 );
  if( type==MessageBytes.T_STR ) {
    convert( mb.getString() );
    // System.out.println("XXX Converting " + mb.getString() );
  } else if( type==MessageBytes.T_CHARS ) {
    CharChunk charC=mb.getCharChunk();
    convert( charC.getBuffer(),
              charC.getStart(), charC.getLength());
    //System.out.println("XXX Converting " + mb.getCharChunk() );
  } else {
    if (logger.isLoggable(Level.FINE)){
      logger.log(Level.FINE, "XXX unknowon type {0}", type);
    }
  }
  //System.out.println("C2B: XXX " + bb.getBuffer() + bb.getLength());
  setByteChunk(orig);
}
origin: org.glassfish.grizzly/grizzly-http-server-core

/** Convert a message bytes chars to bytes
 */
public void convert(MessageBytes mb ) throws IOException {
  int type=mb.getType();
  if( type==MessageBytes.T_BYTES )
    return;
  ByteChunk orig=bb;
  setByteChunk( mb.getByteChunk());
  bb.recycle();
  bb.allocate( 32, -1 );
  if( type==MessageBytes.T_STR ) {
    convert( mb.getString() );
    // System.out.println("XXX Converting " + mb.getString() );
  } else if( type==MessageBytes.T_CHARS ) {
    CharChunk charC=mb.getCharChunk();
    convert( charC.getBuffer(),
              charC.getStart(), charC.getLength());
    //System.out.println("XXX Converting " + mb.getCharChunk() );
  } else {
    if (logger.isLoggable(Level.FINE)){
      logger.log(Level.FINE, "XXX unknowon type {0}", type);
    }
  }
  //System.out.println("C2B: XXX " + bb.getBuffer() + bb.getLength());
  setByteChunk(orig);
}
origin: org.glassfish.grizzly/grizzly-websockets-server

/** Convert a message bytes chars to bytes
 */
public void convert(MessageBytes mb ) throws IOException {
  int type=mb.getType();
  if( type==MessageBytes.T_BYTES )
    return;
  ByteChunk orig=bb;
  setByteChunk( mb.getByteChunk());
  bb.recycle();
  bb.allocate( 32, -1 );
  if( type==MessageBytes.T_STR ) {
    convert( mb.getString() );
    // System.out.println("XXX Converting " + mb.getString() );
  } else if( type==MessageBytes.T_CHARS ) {
    CharChunk charC=mb.getCharChunk();
    convert( charC.getBuffer(),
              charC.getStart(), charC.getLength());
    //System.out.println("XXX Converting " + mb.getCharChunk() );
  } else {
    if (logger.isLoggable(Level.FINE)){
      logger.log(Level.FINE, "XXX unknowon type {0}", type);
    }
  }
  //System.out.println("C2B: XXX " + bb.getBuffer() + bb.getLength());
  setByteChunk(orig);
}
origin: javaee/grizzly

/** Convert a message bytes chars to bytes
 */
public void convert(MessageBytes mb ) throws IOException {
  int type=mb.getType();
  if( type==MessageBytes.T_BYTES )
    return;
  ByteChunk orig=bb;
  setByteChunk( mb.getByteChunk());
  bb.recycle();
  bb.allocate( 32, -1 );
  if( type==MessageBytes.T_STR ) {
    convert( mb.getString() );
    // System.out.println("XXX Converting " + mb.getString() );
  } else if( type==MessageBytes.T_CHARS ) {
    CharChunk charC=mb.getCharChunk();
    convert( charC.getBuffer(),
              charC.getStart(), charC.getLength());
    //System.out.println("XXX Converting " + mb.getCharChunk() );
  } else {
    if (logger.isLoggable(Level.FINE)){
      logger.log(Level.FINE, "XXX unknowon type {0}", type);
    }
  }
  //System.out.println("C2B: XXX " + bb.getBuffer() + bb.getLength());
  setByteChunk(orig);
}
origin: javaee/grizzly

/** Copy the src into this MessageBytes, allocating more space if
 *  needed
 */
public void duplicate( MessageBytes src ) throws IOException {
  // START CR 6309514
  // Discard previous state before duplicating
  recycle();
  // END CR 6309514
  switch( src.getType() ) {
    case MessageBytes.T_BYTES:
      type=T_BYTES;
      ByteChunk bc=src.getByteChunk();
      byteC.allocate( 2 * bc.getLength(), -1 );
      byteC.append( bc );
      break;
    case MessageBytes.T_CHARS:
      type=T_CHARS;
      CharChunk cc=src.getCharChunk();
      charC.allocate( 2 * cc.getLength(), -1 );
      charC.append( cc );
      break;
    case MessageBytes.T_STR:
      type=T_STR;
      String sc=src.getString();
      this.setString( sc );
      break;
  }
}
origin: javaee/grizzly

/** Copy the src into this MessageBytes, allocating more space if
 *  needed
 */
public void duplicate( MessageBytes src ) throws IOException {
  // START CR 6309514
  // Discard previous state before duplicating
  recycle();
  // END CR 6309514
  switch( src.getType() ) {
    case MessageBytes.T_BYTES:
      type=T_BYTES;
      ByteChunk bc=src.getByteChunk();
      byteC.allocate( 2 * bc.getLength(), -1 );
      byteC.append( bc );
      break;
    case MessageBytes.T_CHARS:
      type=T_CHARS;
      CharChunk cc=src.getCharChunk();
      charC.allocate( 2 * cc.getLength(), -1 );
      charC.append( cc );
      break;
    case MessageBytes.T_STR:
      type=T_STR;
      String sc=src.getString();
      this.setString( sc );
      break;
  }
}
org.glassfish.grizzly.http.utilByteChunkallocate

Popular methods of ByteChunk

  • getBuffer
    Returns the message bytes.
  • getEnd
  • getStart
    Returns the start offset of the bytes. For output this is the end of the buffer.
  • <init>
  • append
    Add data to the buffer
  • getBytes
    Returns the message bytes.
  • getLength
    Returns the length of the bytes. XXX need to clean this up
  • indexOf
  • setBytes
    Sets the message bytes to the specified sub-array of bytes.
  • setEnd
  • toString
  • canGrow
  • toString,
  • canGrow,
  • delete,
  • equals,
  • equalsIgnoreCase,
  • equalsIgnoreCaseLowerCase,
  • flushBuffer,
  • getCharset,
  • getInt

Popular in Java

  • Reactive rest calls using spring rest template
  • findViewById (Activity)
  • setScale (BigDecimal)
  • onCreateOptionsMenu (Activity)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now