Examples of DataByteArrayInputStream


Examples of org.apache.activemq.store.kahadb.disk.util.DataByteArrayInputStream

            DataInputStream dataIn = new DataInputStream(is);
            page.set(marshaller.readPayload(dataIn));
            is.close();
        } else {
            // Page header read.
            DataByteArrayInputStream in = new DataByteArrayInputStream(new byte[Page.PAGE_HEADER_SIZE]);
            pageFile.readPage(pageId, in.getRawData());
            page.read(in);
            page.set(null);
        }

        // Cache it.
View Full Code Here

Examples of org.apache.activemq.util.DataByteArrayInputStream

    }


    public Object readItem(Marshaller marshaller, StoreLocation location) throws IOException {
        ByteSequence sequence = dataManager.read(convertFromStoreLocation(location));
        DataByteArrayInputStream dataIn = new DataByteArrayInputStream(sequence);
        return marshaller.readPayload(dataIn);
    }
View Full Code Here

Examples of org.apache.activemq.util.DataByteArrayInputStream

            while (capacity < numberOfBins) {
                capacity <<= 1;
            }
            this.bins = new HashBin[capacity];
            keysPerPage = pageSize / keySize;
            dataIn = new DataByteArrayInputStream();
            dataOut = new DataByteArrayOutputStream(pageSize);
            readBuffer = new byte[pageSize];
            try {
                openIndexFile();
                long offset = 0;
View Full Code Here

Examples of org.apache.activemq.util.DataByteArrayInputStream

    }

    public void load() {
        if (loaded.compareAndSet(false, true)) {
            keysPerPage = pageSize / keySize;
            dataIn = new DataByteArrayInputStream();
            dataOut = new DataByteArrayOutputStream(pageSize);
            readBuffer = new byte[pageSize];
            try {
                openIndexFile();
                long offset = 0;
View Full Code Here

Examples of org.apache.activemq.util.DataByteArrayInputStream

           if (!processedHeaders) {
               currentCommand.write(b);
               // end of headers section, parse action and header
               if (b == '\n' && (previousByte == '\n' || currentCommand.endsWith(crlfcrlf))) {
                   if (transport.getWireFormat() instanceof StompWireFormat) {
                       DataByteArrayInputStream data = new DataByteArrayInputStream(currentCommand.toByteArray());
                       action = ((StompWireFormat)transport.getWireFormat()).parseAction(data);
                       headers = ((StompWireFormat)transport.getWireFormat()).parseHeaders(data);
                       String contentLengthHeader = headers.get(Stomp.Headers.CONTENT_LENGTH);
                       if ((action.equals(Stomp.Commands.SEND) || action.equals(Stomp.Responses.MESSAGE)) && contentLengthHeader != null) {
                           contentLength = ((StompWireFormat)transport.getWireFormat()).parseContentLength(contentLengthHeader);
View Full Code Here

Examples of org.apache.activemq.util.DataByteArrayInputStream

                   if (!processedHeaders) {
                       currentCommand.write(b);
                       // end of headers section, parse action and header
                       if (previousByte == '\n' && b == '\n') {
                           if (wireFormat instanceof StompWireFormat) {
                               DataByteArrayInputStream data = new DataByteArrayInputStream(currentCommand.toByteArray());
                               action = ((StompWireFormat)wireFormat).parseAction(data);
                               headers = ((StompWireFormat)wireFormat).parseHeaders(data);
                               String contentLengthHeader = headers.get(Stomp.Headers.CONTENT_LENGTH);
                               if (contentLengthHeader != null) {
                                   contentLength = ((StompWireFormat)wireFormat).parseContentLength(contentLengthHeader);
View Full Code Here

Examples of org.apache.activemq.util.DataByteArrayInputStream

     *
     * @param file
     */
    StoreIndexReader(RandomAccessFile file){
        this.file=file;
        this.dataIn=new DataByteArrayInputStream();
    }
View Full Code Here

Examples of org.apache.activemq.util.DataByteArrayInputStream

     *
     * @param file
     */
    StoreDataReader(DataManager fileManager){
        this.dataManager=fileManager;
        this.dataIn=new DataByteArrayInputStream();
    }
View Full Code Here

Examples of org.apache.activemq.util.DataByteArrayInputStream

                   if (!processedHeaders) {
                       currentCommand.write(b);
                       // end of headers section, parse action and header
                       if (previousByte == '\n' && b == '\n') {
                           if (wireFormat instanceof StompWireFormat) {
                               DataByteArrayInputStream data = new DataByteArrayInputStream(currentCommand.toByteArray());
                               action = ((StompWireFormat)wireFormat).parseAction(data);
                               headers = ((StompWireFormat)wireFormat).parseHeaders(data);
                               String contentLengthHeader = headers.get(Stomp.Headers.CONTENT_LENGTH);
                               if (contentLengthHeader != null) {
                                   contentLength = ((StompWireFormat)wireFormat).parseContentLength(contentLengthHeader);
View Full Code Here

Examples of org.apache.activemq.util.DataByteArrayInputStream

       DataByteArrayOutputStream os = new DataByteArrayOutputStream(size + 1);
       os.writeByte(expected.type().getNumber());
       expected.writeFramed(os);
       ByteSequence seq = os.toByteSequence();

       DataByteArrayInputStream is = new DataByteArrayInputStream(seq);
       KahaEntryType type = KahaEntryType.valueOf(is.readByte());
       JournalCommand message = (JournalCommand)type.createMessage();
       message.mergeFramed(is);

       assertEquals(expected, message);
    }
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.