Package one.nio.serial

Examples of one.nio.serial.SerializeStream


    @Override
    protected void setValueAt(long entry, V value) {
        try {
            long valueAddress = entry + headerSize(entry);
            serializer.write(value, new SerializeStream(valueAddress, Integer.MAX_VALUE));
        } catch (IOException e) {
            throw new IllegalStateException(e);
        }
    }
View Full Code Here


                    serializers.addAll(collector.serializers());
                }
            }
        });

        SerializeStream ss = new SerializeStream(mmap.getAddr() + CUSTOM_DATA_OFFSET, MAX_CUSTOM_DATA_SIZE);
        try {
            for (Serializer serializer : serializers) {
                ss.writeObject(serializer);
            }
        } catch (IOException e) {
            throw new IllegalStateException(e);
        }

        setHeader(UID_OFFSET, serializer.uid());
        setHeader(CUSTOM_SIZE_OFFSET, ss.count());

        log.info("Stored " + serializers.size() + " serializers. Metadata size = " + ss.count());
    }
View Full Code Here

                            unsafe.putAddress(currentPtr, newEntry);
                            allocator.free(entry);
                            entry = newEntry;
                        }

                        serializer.write(value, new SerializeStream(entry + headerSize, Integer.MAX_VALUE));
                        converted++;
                    }
                }

                totalConverted.addAndGet(converted);
View Full Code Here

        CalcSizeStream css = new CalcSizeStream();
        css.writeObject(request);
        int requestSize = css.count();

        byte[] buffer = new byte[requestSize + 4];
        DataStream ds = css.hasCycles() ? new SerializeStream(buffer) : new DataStream(buffer);
        ds.writeInt(requestSize);
        ds.writeObject(request);
        return buffer;
    }
View Full Code Here

        CalcSizeStream css = new CalcSizeStream();
        css.writeObject(response);
        int responseSize = css.count();
        byte[] buffer = new byte[responseSize + 4];

        DataStream ds = css.hasCycles() ? new SerializeStream(buffer) : new DataStream(buffer);
        ds.writeInt(responseSize);
        ds.writeObject(response);

        super.write(buffer, 0, buffer.length);
    }
View Full Code Here

TOP

Related Classes of one.nio.serial.SerializeStream

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.