Package one.nio.serial

Examples of one.nio.serial.DeserializeStream


    @Override
    protected V valueAt(long entry) {
        try {
            long valueAddress = entry + headerSize(entry);
            return serializer.read(new DeserializeStream(valueAddress, Integer.MAX_VALUE));
        } catch (IOException e) {
            throw new IllegalStateException(e);
        } catch (ClassNotFoundException e) {
            throw new IllegalStateException(e);
        }
View Full Code Here


        if (metadataSize < 0 || metadataSize > MAX_CUSTOM_DATA_SIZE) {
            throw new IllegalStateException("Invalid metadata size: " + metadataSize);
        }

        int count = 0;
        DeserializeStream ds = new DeserializeStream(mmap.getAddr() + CUSTOM_DATA_OFFSET, (int) metadataSize);
        while (ds.available() > 0) {
            try {
                Repository.provideSerializer((Serializer) ds.readObject());
            } catch (IOException e) {
                throw new IllegalStateException(e);
            } catch (ClassNotFoundException e) {
                throw new IllegalStateException(e);
            }
View Full Code Here

                for (int i = taskNum; i < capacity; i += taskCount) {
                    long currentPtr = mapBase + (long) i * 8;
                    for (long entry; (entry = unsafe.getAddress(currentPtr)) != 0; currentPtr = entry + NEXT_OFFSET) {
                        int headerSize = headerSize(entry);
                        V value = oldSerializer.read(new DeserializeStream(entry + headerSize, Integer.MAX_VALUE));

                        int oldSize = sizeOf(entry);
                        int newSize = sizeOf(value);
                        if (newSize > oldSize) {
                            long newEntry = localAllocator.malloc(headerSize + newSize);
View Full Code Here

        byte[] buffer = invokeRaw(request);

        for (;;) {
            Object response;
            try {
                response = new DeserializeStream(buffer).readObject();
            } catch (SerializerNotFoundException e) {
                long uid = e.getUid();
                Repository.provideSerializer(requestSerializer(uid));
                continue;
            }
View Full Code Here

        return (Serializer) invokeServiceRequest(new RemoteCall(Repository.request, uid));
    }

    protected Object invokeServiceRequest(Object request) throws Exception {
        byte[] rawResponse = invokeRaw(request);
        Object response = new DeserializeStream(rawResponse).readObject();
        if (response instanceof Exception) {
            throw (Exception) response;
        }
        return response;
    }
View Full Code Here

        this.bytesRead = 0;
        this.requestSize = 0;

        final Object request;
        try {
            request = new DeserializeStream(buffer, requestSize).readObject();
        } catch (SerializerNotFoundException e) {
            writeResponse(e);
            return;
        } catch (ClassNotFoundException e) {
            handleClassNotFound(e);
View Full Code Here

TOP

Related Classes of one.nio.serial.DeserializeStream

Copyright © 2018 www.massapicom. 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.