本文整理匯總了Java中com.esotericsoftware.kryo.io.Output.writeString方法的典型用法代碼示例。如果您正苦於以下問題:Java Output.writeString方法的具體用法?Java Output.writeString怎麽用?Java Output.writeString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.esotericsoftware.kryo.io.Output
的用法示例。
在下文中一共展示了Output.writeString方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public final void write (Kryo kryo, Output output) {
if (currentReadWriteVersion == -1)
throw new RuntimeException("currentReadWriteVersion must be set before writing.");
if (currentReadWriteVersion < 0 || minimumReadVersion < 0)
throw new RuntimeException("currentReadWriteVersion and minimumReadVersion must not be less than 0.");
if (currentReadWriteVersion < minimumReadVersion)
throw new RuntimeException("currentReadWriteVersion cannot be lower than minimumReadVersion");
Class type = data == null ? null : data.getClass();
pushHeader(kryo, this);
output.writeInt(GRAPH_HEADER_VERSION, true);
kryo.writeClass(output, type);
output.writeInt(Version.MAJOR, true);
output.writeInt(Version.MINOR, true);
output.writeInt(Version.REVISION, true);
output.writeInt(currentReadWriteVersion, true);
output.writeInt(minimumReadVersion, true);
output.writeString(minimumReadVersionString);
output.writeBoolean(useCompactColor);
output.writeBoolean(includePixmapDrawingParams);
writeExtra(kryo, output);
if (data != null)
kryo.writeObject(output, data);
popHeader(kryo);
}
示例2: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
public void write(Kryo kryo, Output output, MapMetaData<Float> object) {
try {
List<Map<String, Float>> mapDataList = mapMetaData.getMapDataList();
mapMetaData.send(output);
int mapSegNum = mapMetaData.getSegNum();
for (int i = 0; i < mapSegNum; i++) {
Map<String, Float> mapData = mapDataList.get(i);
for (Map.Entry<String, Float> entry : mapData.entrySet()) {
output.writeString(entry.getKey());
output.writeFloat(entry.getValue());
}
if (mapMetaData.getCollective() == Collective.GATHER ||
mapMetaData.getCollective() == Collective.SCATTER ||
mapMetaData.getCollective() == Collective.REDUCE_SCATTER) {
mapData.clear();
}
}
} catch (IOException e) {
LOG.error("double array write exception", e);
System.exit(1);
}
}
示例3: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
public void write(Kryo kryo, Output output, ArrayMetaData<String[]> object) {
try {
String[] arrData = arrayMetaData.getArrData();
arrayMetaData.send(output);
int arrSegNum = arrayMetaData.getSegNum();
for (int i = 0; i < arrSegNum; i++) {
int from = arrayMetaData.getFrom(i);
int to = arrayMetaData.getTo(i);
for (int j = from; j < to; j++) {
output.writeString(arrData[j]);
}
}
} catch (IOException e) {
LOG.error("double array write exception", e);
System.exit(1);
}
}
示例4: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
public void write(Kryo kryo, Output output, MapMetaData<T> object) {
try {
List<Map<String, T>> mapDataList = mapMetaData.getMapDataList();
mapMetaData.send(output);
int mapSegNum = mapMetaData.getSegNum();
for (int i = 0; i < mapSegNum; i++) {
Map<String, T> mapData = mapDataList.get(i);
for (Map.Entry<String, T> entry : mapData.entrySet()) {
output.writeString(entry.getKey());
serializer.write(kryo, output, entry.getValue());
}
if (mapMetaData.getCollective() == Collective.GATHER ||
mapMetaData.getCollective() == Collective.SCATTER ||
mapMetaData.getCollective() == Collective.REDUCE_SCATTER) {
mapData.clear();
}
}
} catch (IOException e) {
LOG.error("double array write exception", e);
System.exit(1);
}
}
示例5: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
public void write(Kryo kryo, Output output, MapMetaData<Double> object) {
try {
List<Map<String, Double>> mapDataList = mapMetaData.getMapDataList();
mapMetaData.send(output);
int mapSegNum = mapMetaData.getSegNum();
for (int i = 0; i < mapSegNum; i++) {
Map<String, Double> mapData = mapDataList.get(i);
for (Map.Entry<String, Double> entry : mapData.entrySet()) {
output.writeString(entry.getKey());
output.writeDouble(entry.getValue());
}
if (mapMetaData.getCollective() == Collective.GATHER ||
mapMetaData.getCollective() == Collective.SCATTER ||
mapMetaData.getCollective() == Collective.REDUCE_SCATTER) {
mapData.clear();
}
}
} catch (IOException e) {
LOG.error("double array write exception", e);
System.exit(1);
}
}
示例6: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
public void write(Kryo kryo, Output output, MapMetaData<Short> object) {
try {
List<Map<String, Short>> mapDataList = mapMetaData.getMapDataList();
mapMetaData.send(output);
int mapSegNum = mapMetaData.getSegNum();
for (int i = 0; i < mapSegNum; i++) {
Map<String, Short> mapData = mapDataList.get(i);
for (Map.Entry<String, Short> entry : mapData.entrySet()) {
output.writeString(entry.getKey());
output.writeShort(entry.getValue());
}
if (mapMetaData.getCollective() == Collective.GATHER ||
mapMetaData.getCollective() == Collective.SCATTER ||
mapMetaData.getCollective() == Collective.REDUCE_SCATTER) {
mapData.clear();
}
}
} catch (IOException e) {
LOG.error("double array write exception", e);
System.exit(1);
}
}
示例7: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
public void write(Kryo kryo, Output output, MapMetaData<Long> object) {
try {
List<Map<String, Long>> mapDataList = mapMetaData.getMapDataList();
mapMetaData.send(output);
int mapSegNum = mapMetaData.getSegNum();
for (int i = 0; i < mapSegNum; i++) {
Map<String, Long> mapData = mapDataList.get(i);
for (Map.Entry<String, Long> entry : mapData.entrySet()) {
output.writeString(entry.getKey());
output.writeLong(entry.getValue());
}
if (mapMetaData.getCollective() == Collective.GATHER ||
mapMetaData.getCollective() == Collective.SCATTER ||
mapMetaData.getCollective() == Collective.REDUCE_SCATTER) {
mapData.clear();
}
}
} catch (IOException e) {
LOG.error("double array write exception", e);
System.exit(1);
}
}
示例8: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
public void write(Kryo kryo, Output output, MapMetaData<Integer> object) {
try {
List<Map<String, Integer>> mapDataList = mapMetaData.getMapDataList();
mapMetaData.send(output);
int mapSegNum = mapMetaData.getSegNum();
for (int i = 0; i < mapSegNum; i++) {
Map<String, Integer> mapData = mapDataList.get(i);
for (Map.Entry<String, Integer> entry : mapData.entrySet()) {
output.writeString(entry.getKey());
output.writeInt(entry.getValue());
}
if (mapMetaData.getCollective() == Collective.GATHER ||
mapMetaData.getCollective() == Collective.SCATTER ||
mapMetaData.getCollective() == Collective.REDUCE_SCATTER) {
mapData.clear();
}
}
} catch (IOException e) {
LOG.error("double array write exception", e);
System.exit(1);
}
}
示例9: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
public void write(Kryo kryo, Output output, MapMetaData<Byte> object) {
try {
List<Map<String, Byte>> mapDataList = mapMetaData.getMapDataList();
mapMetaData.send(output);
int mapSegNum = mapMetaData.getSegNum();
for (int i = 0; i < mapSegNum; i++) {
Map<String, Byte> mapData = mapDataList.get(i);
for (Map.Entry<String, Byte> entry : mapData.entrySet()) {
output.writeString(entry.getKey());
output.writeByte(entry.getValue());
}
if (mapMetaData.getCollective() == Collective.GATHER ||
mapMetaData.getCollective() == Collective.SCATTER ||
mapMetaData.getCollective() == Collective.REDUCE_SCATTER) {
mapData.clear();
}
}
} catch (IOException e) {
LOG.error("double array write exception", e);
System.exit(1);
}
}
示例10: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, PortNumber object) {
output.writeBoolean(object.hasName());
output.writeLong(object.toLong());
if (object.hasName()) {
output.writeString(object.name());
}
}
示例11: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, ProviderId object) {
output.writeString(object.scheme());
output.writeString(object.id());
output.writeBoolean(object.isAncillary());
}
示例12: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, NodeId object) {
output.writeString(object.toString());
}
示例13: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, DeviceId object) {
output.writeString(object.toString());
}
示例14: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, URI object) {
output.writeString(object.toString());
}