Examples of compact()


Examples of java.nio.ByteBuffer.compact()

                } finally {
                    outputBuffer.clear();
                }
            }
        } finally {
            inputBuffer.compact();
        }
    }

    public void flush() throws IOException {
        synchronized (decoder) {
View Full Code Here

Examples of java.nio.ByteBuffer.compact()

                }
                checkMaxSize(channel, res);
                if (!buffer.hasRemaining()) {
                    buffer.flip();
                    data.write(buffer);
                    buffer.compact();
                    if (!bufferFullMessage) {
                        //if we are not reading the full message we return
                        return;
                    }
                }
View Full Code Here

Examples of java.nio.ByteBuffer.compact()

        try {
            final ByteBuffer buffer = ByteBuffer.allocate(8 * 1024);
            while (src.read(buffer) != -1) {
                buffer.flip();
                dest.write(buffer);
                buffer.compact();
            }
            buffer.flip();

            while (buffer.hasRemaining()) {
                dest.write(buffer);
View Full Code Here

Examples of java.nio.ByteBuffer.compact()

            ByteBuffer buf = eb.getResource();
            final ByteBuffer ugBuffer = unget.getResource();

            if (ugBuffer.limit() - ugBuffer.remaining() > buf.remaining()) {
                //stuff the existing data after the data we are ungetting
                ugBuffer.compact();
                ugBuffer.put(buf);
                ugBuffer.flip();
                eb.free();
                setExtraBytes(unget);
            } else {
View Full Code Here

Examples of java.nio.ByteBuffer.compact()

                    //in which case we notify the conduit and reset the state
                    if (state.isComplete()) {
                        if (state.prefix == 6) {
                            currentRequest.getAjpClientRequestConduit().setBodyChunkRequested(state.currentIntegerPart);
                            state.reset();
                            buffer.compact();
                        } else if (buffer.hasRemaining()) {
                            free = false;
                            pushBackStreamSourceConduit.pushBack(pooled);
                        }
                    } else {
View Full Code Here

Examples of java.nio.ByteBuffer.compact()

                    //in which case we notify the conduit and reset the state
                    if (state.isComplete()) {
                        if (state.prefix == 6) {
                            currentRequest.getAjpClientRequestConduit().setBodyChunkRequested(state.currentIntegerPart);
                            state.reset();
                            buffer.compact();
                        } else {
                            //todo: ping?
                            UndertowLogger.CLIENT_LOGGER.debugf("Received invalid AJP response code %s with no request active, closing connection", state.prefix);
                            //invalid, at this point read body chunk is all the server should be sending
                            IoUtils.safeClose(connection);
View Full Code Here

Examples of java.nio.CharBuffer.compact()

    h.check(cb.limit(), 7);
    h.check(cb.position(), 4);
    h.check(cb.remaining(), 3);
    try
      {
        cb.compact();
        h.fail("testBasic");
      }
    catch (UnsupportedOperationException ex)
      {
        h.check(true);
View Full Code Here

Examples of javassist.bytecode.ClassFile.compact()

            }
         }
      }

      // Now we've checked the signatures of the class, let's look at the references
      file.compact();
      ConstPool consts = file.getConstPool();
      for (int i = 1; i < consts.getSize(); ++i) // Yes start at 1
      {
         switch (consts.getTag(i))
         {
View Full Code Here

Examples of journal.io.api.Journal.compact()

        for (Location location : journal.redo()) {
            journal.delete(location);
        }

        // Compact logs:
        journal.compact();

        // Close the journal:
        journal.close();
    }
}
View Full Code Here

Examples of lotus.domino.RichTextItem.compact()

      if (doc instanceof lotus.domino.Document) {
        lotus.domino.Document lotusDoc = (lotus.domino.Document) doc;
        RichTextItem rti = lotusDoc.createRichTextItem("body");
        rti.appendText("This is autoexec.bat:");
        rti.embedObject(EmbeddedObject.EMBED_ATTACHMENT, "", "c:\\autoexec.bat", null).recycle();
        rti.compact();
        rti.recycle();
      }
    } catch (NotesException ex) {

    }
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.