Here you can find the source of serializeNull(ByteBuffer buf)
Parameter | Description |
---|---|
buf | <code>ByteBuffer</code> to serialize the decimal into |
static public void serializeNull(ByteBuffer buf)
//package com.java2s; /* This file is part of VoltDB. * Copyright (C) 2008-2015 VoltDB Inc.//w w w . j a v a 2s . c o m * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with VoltDB. If not, see <http://www.gnu.org/licenses/>. */ import java.math.BigInteger; import java.nio.ByteBuffer; public class Main { /** * Array containing the smallest 16-byte twos complement value that is used * as SQL null. */ private static final byte[] NULL_INDICATOR = new BigInteger( "-170141183460469231731687303715884105728").toByteArray(); /** * Serialize the null decimal sigil to a the provided {@link java.nio.ByteBuffer ByteBuffer} * @param buf <code>ByteBuffer</code> to serialize the decimal into */ static public void serializeNull(ByteBuffer buf) { buf.put(NULL_INDICATOR); } }