下面列出了java.io.ObjectOutput#writeLong ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
/** {@inheritDoc} */
@Override protected void writeExternalData(ObjectOutput out) throws IOException {
out.writeLong(totalSpaceSz);
out.writeLong(usedSpaceSz);
out.writeInt(foldersCnt);
out.writeInt(filesCnt);
out.writeInt(filesOpenedForRd);
out.writeInt(filesOpenedForWrt);
out.writeLong(blocksRd);
out.writeLong(blocksRdRmt);
out.writeLong(blocksWrt);
out.writeLong(blocksWrtRmt);
out.writeLong(bytesRd);
out.writeLong(bytesRdTm);
out.writeLong(bytesWrt);
out.writeLong(bytesWrtTm);
}
@Override
public void writeExternal(ObjectOutput out) throws IOException {
out.writeBoolean(operationContext!=null);
if (operationContext!=null)
out.writeObject(operationContext);
out.writeLong(heapConglom);
out.writeLong(tempConglomID);
ArrayUtil.writeIntArray(out, formatIds);
ArrayUtil.writeIntArray(out, columnOrdering);
ArrayUtil.writeIntArray(out, pkCols);
out.writeObject(pkColumns);
out.writeObject(heapList);
out.writeUTF(tableVersion);
SIDriver.driver().getOperationFactory().writeTxn(txn, out);
ArrayUtil.writeIntArray(out, execRowTypeFormatIds);
ArrayUtil.writeIntArray(out, updateCounts);
}
/** {@inheritDoc} */
@Override public void writeExternal(ObjectOutput out) throws IOException {
U.writeString(out, id);
out.writeLong(createTime);
out.writeLong(accessTime);
out.writeInt(maxInactiveInterval);
U.writeMap(out, attrs);
}
/**
* Marshal value to an ObjectOutput sink using RMI's serialization
* format for parameters or return values.
*/
protected static void marshalValue(Class<?> type, Object value,
ObjectOutput out)
throws IOException
{
if (type.isPrimitive()) {
if (type == int.class) {
out.writeInt(((Integer) value).intValue());
} else if (type == boolean.class) {
out.writeBoolean(((Boolean) value).booleanValue());
} else if (type == byte.class) {
out.writeByte(((Byte) value).byteValue());
} else if (type == char.class) {
out.writeChar(((Character) value).charValue());
} else if (type == short.class) {
out.writeShort(((Short) value).shortValue());
} else if (type == long.class) {
out.writeLong(((Long) value).longValue());
} else if (type == float.class) {
out.writeFloat(((Float) value).floatValue());
} else if (type == double.class) {
out.writeDouble(((Double) value).doubleValue());
} else {
throw new Error("Unrecognized primitive type: " + type);
}
} else {
out.writeObject(value);
}
}
/**
* Marshal value to an ObjectOutput sink using RMI's serialization
* format for parameters or return values.
*/
protected static void marshalValue(Class<?> type, Object value,
ObjectOutput out)
throws IOException
{
if (type.isPrimitive()) {
if (type == int.class) {
out.writeInt(((Integer) value).intValue());
} else if (type == boolean.class) {
out.writeBoolean(((Boolean) value).booleanValue());
} else if (type == byte.class) {
out.writeByte(((Byte) value).byteValue());
} else if (type == char.class) {
out.writeChar(((Character) value).charValue());
} else if (type == short.class) {
out.writeShort(((Short) value).shortValue());
} else if (type == long.class) {
out.writeLong(((Long) value).longValue());
} else if (type == float.class) {
out.writeFloat(((Float) value).floatValue());
} else if (type == double.class) {
out.writeDouble(((Double) value).doubleValue());
} else {
throw new Error("Unrecognized primitive type: " + type);
}
} else {
out.writeObject(value);
}
}
public void writeExternal(ObjectOutput out) throws IOException {
out.writeBoolean(z);
out.writeByte(b);
out.writeChar(c);
out.writeShort(s);
out.writeInt(i);
out.writeFloat(f);
out.writeLong(j);
out.writeDouble(d);
out.writeObject(str);
out.writeObject(parent);
out.writeObject(left);
out.writeObject(right);
}
/** {@inheritDoc} */
@Override protected void writeExternalData(ObjectOutput out) throws IOException {
U.writeString(out, path);
out.writeLong(off);
out.writeInt(blockSz);
out.writeLong(lastModified);
}
@Override
public void writeExternal(ObjectOutput out) throws IOException {
out.writeObject(scanSetBuilder);
out.writeUTF(scope);
out.writeUTF(jobGroup);
out.writeUTF(prefix);
out.writeLong(conglomID);
}
@Override
public void writeExternal(ObjectOutput out) throws IOException {
out.writeLong(totalValue.get());
out.writeLong(oldsnapshotValue);
out.writeLong(snapshotValue);
out.writeObject(lastCounterTime);
}
@Override
public void writeExternal(ObjectOutput out) throws IOException {
out.writeLong(id);
out.writeInt(hits.size());
for (int i = 0; i < hits.size(); i++) {
out.writeObject(hits.get(i));
}
}
public void writeExternal(ObjectOutput out) throws IOException
{
checksumValue = checksum.getValue();
out.writeByte(checksumAlgo);
out.writeInt(dataLength);
out.writeLong(checksumValue);
}
public void writeExternal(ObjectOutput out) throws IOException {
out.writeInt(type);
out.writeLong(seqno);
out.writeLong(last_seqno);
out.writeObject(vid);
out.writeObject(stable_msgs);
out.writeObject(sender);
}
@Override
public void writeExternal(ObjectOutput out) throws IOException {
out.writeLong(iRequestId);
out.writeInt(iPriority);
out.writeBoolean(iAlternative);
out.writeLong(iStudentId);
}
@Override
public void writeExternal(ObjectOutput out) throws IOException {
out.writeLong(iUniqueId);
out.writeObject(iName);
out.writeLong(iOfferingId);
out.writeInt(iLimit);
out.writeInt(iSubparts.size());
for (XSubpart subpart: iSubparts)
subpart.writeExternal(out);
out.writeBoolean(iInstructionalMethod != null);
if (iInstructionalMethod != null)
iInstructionalMethod.writeExternal(out);
}
@Override
public void writeExternal(final ObjectOutput out) throws IOException {
// write out the version of the serialized data for future use
out.writeByte(1);
out.writeLong(version);
out.writeObject(connectionStrategy);
out.writeInt(locations.length);
for (final URI uri : locations) {
out.writeObject(uri.toString());
}
}
@Override
public void writeExternal(ObjectOutput out) throws IOException {
out.writeLong(this.id);
out.writeObject(this.user);
out.writeInt(this.ddr16Phase);
}
public void writeExternal(ObjectOutput out) throws IOException
{
out.writeUTF(name);
out.writeLong(generationId);
out.writeBoolean(removeAtOnce);
}
public void writeExternal(ObjectOutput out) throws IOException {
super.writeExternal(out);
out.writeLong(minDev);
out.writeLong(maxDev);
out.writeObject( paramText );
}
public void writeExternal(ObjectOutput out) throws IOException {
out.writeLong(offset);
out.writeLong(limit);
out.writeLong(last);
}
@Override
public void writeExternal(final ObjectOutput out) throws IOException {
out.writeInt(currentVersion);
out.writeLong(addrMetadata);
out.writeLong(addrRoot);
out.writeLong(addrBloomFilter);
out.writeInt(height);
if (currentVersion <= VERSION1) {
if (nnodes > Integer.MAX_VALUE)
throw new RuntimeException();
if (nleaves > Integer.MAX_VALUE)
throw new RuntimeException();
if (nentries > Integer.MAX_VALUE)
throw new RuntimeException();
out.writeInt((int)nnodes);
out.writeInt((int)nleaves);
out.writeInt((int)nentries);
} else {
out.writeLong(nnodes);
out.writeLong(nleaves);
out.writeLong(nentries);
out.writeLong(recordVersion);
}
out.writeLong(counter);
/*
* 8 bytes follow.
*/
out.writeShort(indexType.getCode());
out.writeShort(0/* unused */);
out.writeInt(0/* unused */);
/*
* 8 bytes follow.
*/
out.writeLong(0L/* unused */);
/*
* Additional space added in VERSION2.
*/
for (int i = 0; i < 10; i++) {
out.writeLong(0L/* unused */);
}
}