Examples of ByteBuffer


Examples of org.infinispan.io.ByteBuffer

      log = LogFactory.getLog(getClass());
      trace = log.isTraceEnabled();
   }

   public byte[] objectToByteBuffer(Object obj) throws IOException {
      ByteBuffer b = objectToBuffer(obj);
      byte[] bytes = new byte[b.getLength()];
      System.arraycopy(b.getBuf(), b.getOffset(), bytes, 0, b.getLength());
      return bytes;
   }
View Full Code Here

Examples of org.jboss.cache.io.ByteBuffer

      //now marshall the contents of the object
      defaultMarshaller.objectToObjectStream(obj, out);
      out.close();

      // and return bytes.
      return new ByteBuffer(baos.getRawBuffer(), 0, baos.size());
   }
View Full Code Here

Examples of org.jfree.fonts.encoding.ByteBuffer

  public ByteBuffer encode(final CodePointBuffer text, ByteBuffer buffer)
  {
    final int textLength = text.getLength();
    if (buffer == null)
    {
      buffer = new ByteBuffer(textLength);
    }
    else if (buffer.getLength() < textLength)
    {
      buffer.ensureSize(textLength);
    }
View Full Code Here

Examples of org.jostraca.comp.antlr.ByteBuffer

public class DirectiveAntlrLexer extends org.jostraca.comp.antlr.CharScanner implements DirectiveAntlrLexerTokenTypes, TokenStream
{

  private boolean iDirectiveNameSeen = false;
public DirectiveAntlrLexer(InputStream in) {
  this(new ByteBuffer(in));
}
View Full Code Here

Examples of org.kocakosm.pitaya.util.ByteBuffer

  @Test
  public void testRead() throws IOException
  {
    InputStream data = new ByteArrayInputStream(DATA);
    CountingInputStream in = new CountingInputStream(data);
    ByteBuffer buf = new ByteBuffer();
    buf.append((byte) in.read());
    byte[] b = new byte[5];
    in.read(b);
    buf.append(b);
    b = new byte[20];
    int len = in.read(b, 0, 15);
    buf.append(b, 0, len);
    assertEquals(16, in.getCount());
    assertArrayEquals(DATA, buf.toByteArray());
  }
View Full Code Here

Examples of org.kohsuke.stapler.framework.io.ByteBuffer

        /**
         * Creates one that's backed by memory.
         */
        public static ListenerAndText forMemory(TaskAction context) {
            // StringWriter is synchronized
            ByteBuffer log = new ByteBuffer();

            return new ListenerAndText(
                new StreamTaskListener(log),
                new AnnotatedLargeText<TaskAction>(log,Charset.defaultCharset(),false,context)
            );
View Full Code Here

Examples of org.pentaho.reporting.libraries.fonts.encoding.ByteBuffer

  public ByteBuffer encode(final CodePointBuffer text, ByteBuffer buffer)
  {
    final int textLength = text.getLength();
    if (buffer == null)
    {
      buffer = new ByteBuffer(textLength);
    }
    else if (buffer.getLength() < textLength)
    {
      buffer.ensureSize(textLength);
    }
View Full Code Here

Examples of org.smpp.util.ByteBuffer

   */
  final protected PDU receivePDUFromConnection(Connection connection, Unprocessed unprocessed)
    throws UnknownCommandIdException, TimeoutException, PDUException, IOException {
    debug.write(DRXTXD2, "ReceiverBase.receivePDUFromConnection start");
    PDU pdu = null;
    ByteBuffer buffer;
    ByteBuffer unprocBuffer;
   
    try {
      // first check if there is something left from the last time
      if (unprocessed.getHasUnprocessed()) {
        unprocBuffer = unprocessed.getUnprocessed();
        debug.write(DRXTX, "have unprocessed " + unprocBuffer.length() + " bytes from previous try");
        pdu = tryGetUnprocessedPDU(unprocessed);
      }
      if (pdu == null) { // only if we didn't manage to get pdu from unproc
        buffer = connection.receive();
        unprocBuffer = unprocessed.getUnprocessed();
        // if received something now or have something from the last receive
        if (buffer.length() != 0) {
          unprocBuffer.appendBuffer(buffer);
          unprocessed.setLastTimeReceived();
          pdu = tryGetUnprocessedPDU(unprocessed);
        } else {
          debug.write(DRXTXD2, "no data received this time.");
          // check if it's not too long since we received any data
          long timeout = getReceiveTimeout();
          if ((unprocBuffer.length() > 0)
            && ((unprocessed.getLastTimeReceived() + timeout) < Data.getCurrentTime())) {
            debug.write(DRXTX, "and it's been very long time.");
            unprocessed.reset();
            throw new TimeoutException(timeout, unprocessed.getExpected(), unprocBuffer.length());
          }
        }
      }
    }
    catch (UnknownCommandIdException e) {
View Full Code Here

Examples of org.teavm.classlib.impl.charset.ByteBuffer

        inBuffer.rewind(0);
        while (off < inData.length) {
            int bytesRead = stream.read(inData, off, inData.length - off);
            if (bytesRead == -1) {
                streamEof = true;
                inBuffer = new ByteBuffer(inData, 0, inBuffer.position());
                break;
            } else {
                off += bytesRead;
                if (bytesRead == 0) {
                    break;
                }
            }
        }
        inBuffer = new ByteBuffer(inData, 0, off);
        return true;
    }
View Full Code Here

Examples of persistence.antlr.ByteBuffer

    else {
      antlrTool.warning(s,getFilename(),getLine(), getColumn());
    }
  }
public ActionLexer(InputStream in) {
  this(new ByteBuffer(in));
}
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.