Examples of asBytes()


Examples of com.fasterxml.clustermate.service.store.EntryLastAccessed.asBytes()

             *   minor deviations from exact value are ok (deletion occurs after hours,
             *   or at most minutes since last access), so let's avoid extra lookup.
             *   Same goes for other settings
             */
            EntryLastAccessed acc = _entryConverter.createLastAccessed(entry, timestamp);
            _store.put(null, lastAccessKey, new DatabaseEntry(acc.asBytes()));
        }
    }

    @Override
    public boolean removeLastAccess(K key, LastAccessUpdateMethod method, long timestamp) {
View Full Code Here

Examples of com.fasterxml.clustermate.service.store.EntryLastAccessed.asBytes()

             *   minor deviations from exact value are ok (deletion occurs after hours,
             *   or at most minutes since last access), so let's avoid extra lookup.
             *   Same goes for other settings
             */
            EntryLastAccessed acc = _entryConverter.createLastAccessed(entry, timestamp);
            _store.put(null, lastAccessKey, new DatabaseEntry(acc.asBytes()));
        }
    }

    /**
     * @return True if an entry was deleted; false otherwise (usually since there
View Full Code Here

Examples of com.fasterxml.storemate.shared.StorableKey.asBytes()

                iter.seekToFirst();

                while (iter.hasNext()) {
                    Map.Entry<byte[], byte[]> entry = iter.next();
                    key = _storableKey(entry.getKey());
                    byte[] b = key.asBytes();
                    EntryLastAccessed lastAcc = _lastAccessedConverter.createLastAccessed(b, 0, b.length);
                    if (cb.processEntry(key, lastAcc) == IterationAction.TERMINATE_ITERATION) {
                        return IterationResult.TERMINATED_FOR_ENTRY;
                    }
                }
View Full Code Here

Examples of com.fasterxml.storemate.store.lastaccess.EntryLastAccessed.asBytes()

             *   or at most minutes since last access), so let's avoid extra lookup.
             *   Same goes for other settings
             */
            EntryLastAccessed acc = _lastAccessedConverter.createLastAccessed(entry, timestamp);
                    //_entryConverter.createLastAccessed(entry, timestamp);
            _store.put(null, lastAccessKey, new DatabaseEntry(acc.asBytes()));
        }
    }

    @Override
    public boolean removeLastAccess(K key, ACC method, long timestamp) {
View Full Code Here

Examples of com.github.restdriver.serverdriver.http.response.DefaultResponse.asBytes()

        when(mockEntity.getContent()).thenReturn(new ByteArrayInputStream(bytes));
        HttpResponse mockResponse = createMockResponse(mockEntity);
       
        Response response = new DefaultResponse(mockResponse, 12345);
       
        assertThat(response.asBytes(), is(bytes));
        assertThat(response.asText(), is("Jeff"));
    }
   
    @Test
    public void asJsonErrorGivesClearMessage() throws IOException {
View Full Code Here

Examples of com.github.restdriver.serverdriver.http.response.DefaultResponse.asBytes()

        when(mockEntity.getContent()).thenReturn(new ByteArrayInputStream(bytes));
        HttpResponse mockResponse = createMockResponse(mockEntity);
       
        Response response = new DefaultResponse(mockResponse, 12345);
       
        assertThat(response.asBytes(), is(bytes));
    }
   
    @Test
    public void stringAndBytesWorkTogether() throws Exception {
       
View Full Code Here

Examples of com.github.restdriver.serverdriver.http.response.Response.asBytes()

        when(mockEntity.getContent()).thenReturn(new ByteArrayInputStream(bytes));
        HttpResponse mockResponse = createMockResponse(mockEntity);
       
        Response response = new DefaultResponse(mockResponse, 12345);
       
        assertThat(response.asBytes(), is(bytes));
    }
   
    @Test
    public void stringAndBytesWorkTogether() throws Exception {
       
View Full Code Here

Examples of com.github.restdriver.serverdriver.http.response.Response.asBytes()

        when(mockEntity.getContent()).thenReturn(new ByteArrayInputStream(bytes));
        HttpResponse mockResponse = createMockResponse(mockEntity);
       
        Response response = new DefaultResponse(mockResponse, 12345);
       
        assertThat(response.asBytes(), is(bytes));
        assertThat(response.asText(), is("Jeff"));
    }
   
    @Test
    public void asJsonErrorGivesClearMessage() throws IOException {
View Full Code Here

Examples of com.google.common.hash.HashCode.asBytes()

    }

    public static BlobData build(ByteSource src) throws IOException {
        HashCode hashCode = src.hash(Hashing.md5());
        ByteString hash = ByteString.copyFrom(hashCode.asBytes());

        return new BlobData(src, hash);
    }

    public static BlobData build(File file) throws IOException {
View Full Code Here

Examples of com.google.common.hash.HashCode.asBytes()

        byte[] data = randomBytes(ThreadLocalRandom.current().nextInt(16));

        HashCode expected = Hashing.murmur3_128().hashBytes(data);
        Slice actual = Murmur3.hash(Slices.wrappedBuffer(data));

        assertEquals(actual.getBytes(), expected.asBytes());
    }

    @Test(invocationCount = 100)
    public void testMoreThan16Bytes()
            throws Exception
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.