本文整理了Java中com.esotericsoftware.kryo.io.Output.require()
方法的一些代码示例,展示了Output.require()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Output.require()
方法的具体详情如下:
包路径:com.esotericsoftware.kryo.io.Output
类名称:Output
方法名:require
暂无
代码示例来源:origin: com.esotericsoftware/kryo
/** Writes an 8 byte long. Uses BIG_ENDIAN byte order. */
public void writeLong (long value) throws KryoException {
require(8);
byte[] buffer = this.buffer;
buffer[position++] = (byte)(value >>> 56);
buffer[position++] = (byte)(value >>> 48);
buffer[position++] = (byte)(value >>> 40);
buffer[position++] = (byte)(value >>> 32);
buffer[position++] = (byte)(value >>> 24);
buffer[position++] = (byte)(value >>> 16);
buffer[position++] = (byte)(value >>> 8);
buffer[position++] = (byte)value;
}
代码示例来源:origin: com.esotericsoftware/kryo-shaded
/** Writes a 2 byte char. Uses BIG_ENDIAN byte order. */
public void writeChar (char value) throws KryoException {
require(2);
buffer[position++] = (byte)(value >>> 8);
buffer[position++] = (byte)value;
}
代码示例来源:origin: com.esotericsoftware/kryo
/** Writes a byte. */
public void write (int value) throws KryoException {
if (position == capacity) require(1);
buffer[position++] = (byte)value;
}
代码示例来源:origin: com.esotericsoftware/kryo
/** Writes a 2 byte char. Uses BIG_ENDIAN byte order. */
public void writeChar (char value) throws KryoException {
require(2);
buffer[position++] = (byte)(value >>> 8);
buffer[position++] = (byte)value;
}
代码示例来源:origin: svn2github/kryo
/** Writes a 2 byte char. Uses BIG_ENDIAN byte order. */
public void writeChar (char value) throws KryoException {
require(2);
buffer[position++] = (byte)(value >>> 8);
buffer[position++] = (byte)value;
}
代码示例来源:origin: com.esotericsoftware.kryo/kryo
/** Writes a byte. */
public void write (int value) throws KryoException {
if (position == capacity) require(1);
buffer[position++] = (byte)value;
}
代码示例来源:origin: com.esotericsoftware.kryo/kryo
public void writeByte (byte value) throws KryoException {
if (position == capacity) require(1);
buffer[position++] = value;
}
代码示例来源:origin: com.esotericsoftware.kryo/kryo
public void writeByte (int value) throws KryoException {
if (position == capacity) require(1);
buffer[position++] = (byte)value;
}
代码示例来源:origin: com.esotericsoftware/kryo-shaded
/** Writes a 2 byte short. Uses BIG_ENDIAN byte order. */
public void writeShort (int value) throws KryoException {
require(2);
buffer[position++] = (byte)(value >>> 8);
buffer[position++] = (byte)value;
}
代码示例来源:origin: com.esotericsoftware/kryo
/** Writes a 2 byte short. Uses BIG_ENDIAN byte order. */
public void writeShort (int value) throws KryoException {
require(2);
buffer[position++] = (byte)(value >>> 8);
buffer[position++] = (byte)value;
}
代码示例来源:origin: com.esotericsoftware/kryo-shaded
/** Writes an 8 byte long. Uses BIG_ENDIAN byte order. */
public void writeLong (long value) throws KryoException {
require(8);
byte[] buffer = this.buffer;
buffer[position++] = (byte)(value >>> 56);
buffer[position++] = (byte)(value >>> 48);
buffer[position++] = (byte)(value >>> 40);
buffer[position++] = (byte)(value >>> 32);
buffer[position++] = (byte)(value >>> 24);
buffer[position++] = (byte)(value >>> 16);
buffer[position++] = (byte)(value >>> 8);
buffer[position++] = (byte)value;
}
代码示例来源:origin: com.esotericsoftware/kryo
/** Writes a 4 byte int. Uses BIG_ENDIAN byte order. */
public void writeInt (int value) throws KryoException {
require(4);
byte[] buffer = this.buffer;
buffer[position++] = (byte)(value >> 24);
buffer[position++] = (byte)(value >> 16);
buffer[position++] = (byte)(value >> 8);
buffer[position++] = (byte)value;
}
代码示例来源:origin: com.esotericsoftware/kryo
/** Writes a 1 byte boolean. */
public void writeBoolean (boolean value) throws KryoException {
if (position == capacity) require(1);
buffer[position++] = (byte)(value ? 1 : 0);
}
代码示例来源:origin: com.esotericsoftware.kryo/kryo
/** Writes a 4 byte int. Uses BIG_ENDIAN byte order. */
public void writeInt (int value) throws KryoException {
require(4);
byte[] buffer = this.buffer;
buffer[position++] = (byte)(value >> 24);
buffer[position++] = (byte)(value >> 16);
buffer[position++] = (byte)(value >> 8);
buffer[position++] = (byte)value;
}
代码示例来源:origin: com.esotericsoftware.kryo/kryo
/** Writes a 2 byte short. Uses BIG_ENDIAN byte order. */
public void writeShort (int value) throws KryoException {
require(2);
buffer[position++] = (byte)(value >>> 8);
buffer[position++] = (byte)value;
}
代码示例来源:origin: com.esotericsoftware.kryo/kryo
/** Writes a 1 byte boolean. */
public void writeBoolean (boolean value) throws KryoException {
if (position == capacity) require(1);
buffer[position++] = (byte)(value ? 1 : 0);
}
代码示例来源:origin: com.esotericsoftware.kryo/kryo
/** Writes a 2 byte char. Uses BIG_ENDIAN byte order. */
public void writeChar (char value) throws KryoException {
require(2);
buffer[position++] = (byte)(value >>> 8);
buffer[position++] = (byte)value;
}
代码示例来源:origin: com.esotericsoftware.kryo/kryo
/** Writes an 8 byte long. Uses BIG_ENDIAN byte order. */
public void writeLong (long value) throws KryoException {
require(8);
byte[] buffer = this.buffer;
buffer[position++] = (byte)(value >>> 56);
buffer[position++] = (byte)(value >>> 48);
buffer[position++] = (byte)(value >>> 40);
buffer[position++] = (byte)(value >>> 32);
buffer[position++] = (byte)(value >>> 24);
buffer[position++] = (byte)(value >>> 16);
buffer[position++] = (byte)(value >>> 8);
buffer[position++] = (byte)value;
}
代码示例来源:origin: svn2github/kryo
/** Writes a 2 byte short. Uses BIG_ENDIAN byte order. */
public void writeShort (int value) throws KryoException {
require(2);
buffer[position++] = (byte)(value >>> 8);
buffer[position++] = (byte)value;
}
代码示例来源:origin: com.esotericsoftware.kryo/kryo
private void writeAscii_slow (String value, int charCount) throws KryoException {
byte[] buffer = this.buffer;
int charIndex = 0;
int charsToWrite = Math.min(charCount, capacity - position);
while (charIndex < charCount) {
value.getBytes(charIndex, charIndex + charsToWrite, buffer, position);
charIndex += charsToWrite;
position += charsToWrite;
charsToWrite = Math.min(charCount - charIndex, capacity);
if (require(charsToWrite)) buffer = this.buffer;
}
}
内容来源于网络,如有侵权,请联系作者删除!