Guava PrimitiveSink - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Guava PrimitiveSink class.

This code example shows how to use the following methods:putLong
    } else if (o instanceof Float) {
      into.putFloat((Float) o);
    } else if (o instanceof Integer) {
      into.putInt((Integer) o);
    } else if (o instanceof Long) {
      into.putLong((Long) o);
    } else if (o instanceof String) {
      into.putUnencodedChars((String) o);
    } 
  } 
} 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:putLong
     */ 
    enum FileNodeFunnel implements Funnel<IData> {
        INSTANCE;
        public void funnel(IData data, PrimitiveSink into) {
            final FileData from = (FileData)data;
            into.putLong(from.dataKey).putBytes(from.val).putBoolean(from.eof);
        } 
    } 
 
    /** 
     * The nodes key value, which is equal with it's position in the list. 
     */ 
    private final long dataKey;
 
    /** 
     * The size of the filenode 
     */ 
    public static final int FILENODESIZE = 1024 * 16;
 
    /** 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:putLong
     */ 
    enum ByteDataFunnel implements Funnel<IData> {
        INSTANCE;
        public void funnel(IData data, PrimitiveSink into) {
            final BlockDataElement from = (BlockDataElement)data;
            into.putLong(from.dataKey).putBytes(from.val).putInt(from.size);
        } 
    } 
 
    /** 
     * The datas key value, which is equal with it's position in the list. 
     */ 
    private final long dataKey;
 
    /** 
     * The size of the byte array in the data. The maximum size of a byte array in 
     * a {@link BlockDataElement} is 2^32 - 1. This is because in the deserialization the 
     * first 4 bytes determine the size of each data. 
     */ 
    private int size = 0;
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:putLong
     */ 
    enum AtomicValueFunnel implements Funnel<org.treetank.api.IData> {
        INSTANCE;
        public void funnel(org.treetank.api.IData data, PrimitiveSink into) {
            final AtomicValue from = (AtomicValue)data;
            into.putLong(from.mItemKey).putBytes(from.mValue).putInt(from.mType);
        } 
    } 
 
    /** Value of the item as byte array. */ 
    private byte[] mValue;
 
    /** The item's value type. */ 
    private int mType;
 
    /** 
     * The item's key. In case of an Atomic value this is always a negative to 
     * make them distinguishable from nodes. 
     */ 
    private long mItemKey;
3
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:putLong
         */ 
        enum DumbValueFunnel implements Funnel<IMetaEntry> {
            INSTANCE;
            public void funnel(IMetaEntry from, PrimitiveSink into) {
                DumbValue data = (DumbValue)from;
                into.putLong(data.mData);
            } 
        } 
 
        /** The data itself. */ 
        private final long mData;
 
        /** 
         * Constructor. 
         *  
         * @param pData 
         *            setting the data 
         */ 
        public DumbValue(final long pData) {
            mData = pData;
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:putBytes
    } 
 
    private class BigIntegerFunnel implements Funnel<BigInteger> {
        @Override 
        public void funnel(BigInteger from, PrimitiveSink into) {
            into.putBytes(from.toByteArray());
        } 
    } 
 
} 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:putBytes
public enum ByteableFunnel implements Funnel<Composite> {
    INSTANCE;
 
    @Override 
    public void funnel(Composite from, PrimitiveSink into) {
        into.putBytes(ByteBuffers.toByteArray(from.getBytes()));
    } 
} 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:putInt
         */ 
        enum MetaKeyFunnel implements Funnel<IMetaEntry> {
            INSTANCE;
            public void funnel(IMetaEntry from, PrimitiveSink into) {
                MetaKey node = (MetaKey)from;
                into.putInt(node.mKey);
            } 
        } 
 
        /** Key Variable. */ 
        private final int mKey;
 
        /** 
         * Constructor 
         *  
         * @param pData 
         *            setting the key 
         */ 
        public MetaKey(final int pData) {
            mKey = pData;
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:putBytes
     */ 
    enum ValNodeDelegateFunnel implements Funnel<org.treetank.api.IData> {
        INSTANCE;
        public void funnel(org.treetank.api.IData data, PrimitiveSink into) {
            final ITreeValData from = (ITreeValData)data;
            into.putBytes(from.getRawValue());
        } 
    } 
 
    /** Delegate for common node information. */ 
    private NodeDelegate mDelegate;
    /** Storing the value. */ 
    private byte[] mVal;
 
    /** 
     * Constructor 
     *  
     * @param pNodeDel 
     *            the common data. 
     * @param pVal 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
See Code Examples for Guava PrimitiveSink Methods: