Examples of toByteBuffer()


Examples of org.hornetq.api.core.HornetQBuffer.toByteBuffer()

               HornetQBuffer bodyBuffer = HornetQBuffers.fixedBuffer(localChunkLen);

               context.encode(bodyBuffer, localChunkLen);

               byte[] body = bodyBuffer.toByteBuffer().array();

               int packetSize = callback.sendLargeMessageContinuation(id,
                                                                      body,
                                                                      positionPendingLargeMessage + localChunkLen < sizePendingLargeMessage,
                                                                      false);
View Full Code Here

Examples of org.hornetq.api.core.HornetQBuffer.toByteBuffer()

               HornetQBuffer bodyBuffer = HornetQBuffers.fixedBuffer(localChunkLen);

               context.encode(bodyBuffer, localChunkLen);

               byte[] body = bodyBuffer.toByteBuffer().array();

               int packetSize = callback.sendLargeMessageContinuation(id,
                                                                      body,
                                                                      positionPendingLargeMessage + localChunkLen < sizePendingLargeMessage,
                                                                      false);
View Full Code Here

Examples of org.hornetq.api.core.HornetQBuffer.toByteBuffer()

            {
               bufferSize = remainder;
            }
            HornetQBuffer buffer = HornetQBuffers.fixedBuffer(bufferSize.intValue());
            encoder.encode(buffer, bufferSize.intValue());
            xmlWriter.writeCData(encode(buffer.toByteBuffer().array()));
            totalBytesWritten += bufferSize;
         }
         encoder.close();
      }
      catch (HornetQException e)
View Full Code Here

Examples of org.hornetq.api.core.HornetQBuffer.toByteBuffer()

         }

         JournalInternalRecord controlRecord = new JournalAddRecord(true,
                                                                    1,
                                                                    (byte)0,
                                                                    new ByteArrayEncoding(filesToRename.toByteBuffer()
                                                                                                       .array()));

         HornetQBuffer renameBuffer = HornetQBuffers.dynamicBuffer(filesToRename.writerIndex());

         controlRecord.setFileID(0);
View Full Code Here

Examples of org.hornetq.api.core.HornetQBuffer.toByteBuffer()

         controlRecord.encode(renameBuffer);

         ByteBuffer writeBuffer = fileFactory.newBuffer(renameBuffer.writerIndex());

         writeBuffer.put(renameBuffer.toByteBuffer().array(), 0, renameBuffer.writerIndex());

         writeBuffer.rewind();

         controlFile.writeDirect(writeBuffer, true);
View Full Code Here

Examples of org.iq80.leveldb.util.Slice.toByteBuffer()

        // create a handle to this block
        BlockHandle blockHandle = new BlockHandle(position, blockContents.length());

        // write data and trailer
        position += fileChannel.write(new ByteBuffer[]{blockContents.toByteBuffer(), trailer.toByteBuffer()});

        // clean up state
        blockBuilder.reset();

        return blockHandle;
View Full Code Here

Examples of org.iq80.leveldb.util.Slice.toByteBuffer()

        BlockHandle indexBlockHandle = writeBlock(indexBlockBuilder);

        // write footer
        Footer footer = new Footer(metaindexBlockHandle, indexBlockHandle);
        Slice footerEncoding = Footer.writeFooter(footer);
        position += fileChannel.write(footerEncoding.toByteBuffer());
    }

    public void abandon()
    {
        Preconditions.checkState(!closed, "table is finished");
View Full Code Here

Examples of org.jboss.netty.buffer.ChannelBuffer.toByteBuffer()

                return;

            }
            final ChannelBuffer buffer = (ChannelBuffer) msg;
            final byte[] payload = new byte[buffer.readableBytes()];
            buffer.toByteBuffer().get(payload, buffer.readerIndex(), buffer.readableBytes());

            final RawMessage raw = new RawMessage(input.getCodec().getName(), input.getId(),
                                                  (InetSocketAddress) e.getRemoteAddress(), payload);
            input.processRawMessage(raw);
        }
View Full Code Here

Examples of org.jboss.netty.buffer.ChannelBuffer.toByteBuffer()

        }

        // Otherwise, all messages are encrypted.
        ChannelBuffer msg = (ChannelBuffer) e.getMessage();
        PendingWrite pendingWrite =
            new PendingWrite(evt.getFuture(), msg.toByteBuffer(msg.readerIndex(), msg.readableBytes()));
        synchronized (pendingUnencryptedWrites) {
            boolean offered = pendingUnencryptedWrites.offer(pendingWrite);
            assert offered;
        }
View Full Code Here

Examples of org.jboss.netty.buffer.ChannelBuffer.toByteBuffer()

            } catch (IOException e) {
                exception = e;
                closed = true;
            }
        } else if (channel instanceof MultipointReadableMessageChannel) {
            ByteBuffer nioBuf = buf.toByteBuffer();
            try {
                MultipointReadResult res = ((MultipointReadableMessageChannel) channel).receive(nioBuf);
                if (res != null) {
                    buf = ChannelBuffers.wrappedBuffer(nioBuf);
                    remoteAddress = (SocketAddress) res.getSourceAddress();
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.