本文整理汇总了Java中java.io.ObjectInputStream.readByte方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectInputStream.readByte方法的具体用法?Java ObjectInputStream.readByte怎么用?Java ObjectInputStream.readByte使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.io.ObjectInputStream
的用法示例。
在下文中一共展示了ObjectInputStream.readByte方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: decodeResonse
import java.io.ObjectInputStream; //导入方法依赖的package包/类
private ResponseMessage decodeResonse(ObjectInputStream input) throws IOException, ClassNotFoundException{
ResponseMessage res = new ResponseMessage();
byte staus = input.readByte();
switch (staus) {
case DubboAdapter.RESPONSE_NULL_VALUE:
break;
case DubboAdapter.RESPONSE_VALUE:
res.setResponse(readObject(input));
break;
case DubboAdapter.RESPONSE_WITH_EXCEPTION:
res.setException((Throwable)readObject(input));
break;
default:
break;
}
return res;
}
示例2: doReps
import java.io.ObjectInputStream; //导入方法依赖的package包/类
/**
* Run benchmark for given number of batches, with given number of cycles
* for each batch.
*/
void doReps(ObjectOutputStream oout, ObjectInputStream oin,
StreamBuffer sbuf, int nbatches, int ncycles)
throws Exception
{
for (int i = 0; i < nbatches; i++) {
sbuf.reset();
for (int j = 0; j < ncycles; j++) {
oout.writeByte(0);
}
oout.flush();
for (int j = 0; j < ncycles; j++) {
oin.readByte();
}
}
}
示例3: readObject
import java.io.ObjectInputStream; //导入方法依赖的package包/类
private void readObject(ObjectInputStream in)
throws IOException, ClassNotFoundException
{
z = in.readBoolean();
b = in.readByte();
c = in.readChar();
s = in.readShort();
i = in.readInt();
f = in.readFloat();
j = in.readLong();
d = in.readDouble();
str = (String) in.readObject();
parent = in.readObject();
left = in.readObject();
right = in.readObject();
}
示例4: deserializeMainFile
import java.io.ObjectInputStream; //导入方法依赖的package包/类
@Override
public void deserializeMainFile(ObjectInputStream objectInputStream) throws IOException,
ClassNotFoundException {
int arrayLength = objectInputStream.readInt();
this.data = new byte[arrayLength][][];
this.dataOffsets = new int[arrayLength][][];
this.nextIDNeverYetAssigned = objectInputStream.readLong();
this.nextBucketOffset = objectInputStream.readByte();
this.nextBucketId = objectInputStream.readInt();
this.nextPartitionId = objectInputStream.readInt();
this.recycledIdsSize = objectInputStream.readInt();
this.recycledIds = (long[]) objectInputStream.readObject();
}
示例5: readObject
import java.io.ObjectInputStream; //导入方法依赖的package包/类
private Object readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {
byte b = ois.readByte();
if( b == 0 )
return null;
return ois.readObject();
}
示例6: importType
import java.io.ObjectInputStream; //导入方法依赖的package包/类
private TypeElem importType(ObjectInputStream in, String modulo)throws IOException,
ClassNotFoundException{
String name=in.readUTF();
boolean explic=in.readBoolean();
int i=in.readInt();
Membro[] mem=new Membro[i];
for(int j=0; j<i; j++){
int perms=in.readByte()&0xFF;
TypeName ty=(TypeName)in.readObject();
String na=in.readUTF();
int len=in.readInt();
TypeName[] par=new TypeName[len];
for(int k=0; k<len; k++)
par[k]=(TypeName)in.readObject();
TemplateEle pack=null;
if(in.readBoolean())
pack=new NumDich(in.readLong(), 2);
boolean shadow=(perms % 3)==1;
boolean read=(perms % 3)==2;
perms=perms/3;
boolean gpacked=(perms % 3)==1;
boolean ghost=(perms % 3)==2;
mem[j]=new Membro(ty, na, par, shadow, read, gpacked, ghost, pack);
}
TypeName ex=null;
if(in.readBoolean())
ex=(TypeName)in.readObject();
return new TypeElem(name, ex, mem, modulo, explic);
}
示例7: readObject
import java.io.ObjectInputStream; //导入方法依赖的package包/类
void readObject(ObjectInputStream in) throws IOException {
int arrSize;
mode = in.readInt();
for (int i = 0; i < generalNumbers.length; i++) {
generalNumbers[i] = in.readLong();
}
if (mode == CommonConstants.MODE_THREADS_SAMPLING) {
nThreads = in.readInt();
nThreadStates = in.readInt();
if (threadIds.length < nThreads) {
threadIds = new int[nThreads];
}
if (stateTimestamps.length < nThreadStates) {
stateTimestamps = new long[nThreadStates];
}
int len = nThreads * nThreadStates;
if (threadStates.length < len) {
threadStates = new byte[len];
}
for (int i = 0; i < nThreads; i++) {
threadIds[i] = in.readInt();
}
for (int i = 0; i < nThreadStates; i++) {
stateTimestamps[i] = in.readLong();
}
in.readFully(threadStates, 0, len);
} else if (mode == CommonConstants.MODE_THREADS_EXACT) {
int exactLen = in.readInt();
exactThreadIds = new int[exactLen];
exactThreadStates = new byte[exactLen];
exactTimeStamps = new long[exactLen];
for (int i = 0; i < exactLen; i++) {
exactThreadIds[i] = in.readInt();
exactThreadStates[i] = in.readByte();
exactTimeStamps[i] = in.readLong();
}
}
nNewThreads = in.readInt();
if (nNewThreads > 0) {
if ((newThreadIds == null) || (newThreadIds.length < nNewThreads)) {
newThreadIds = new int[nNewThreads];
newThreadNames = new String[nNewThreads];
newThreadClassNames = new String[nNewThreads];
}
for (int i = 0; i < nNewThreads; i++) {
newThreadIds[i] = in.readInt();
newThreadNames[i] = in.readUTF();
newThreadClassNames[i] = in.readUTF();
}
}
arrSize = in.readInt();
gcStarts = new long[arrSize];
for (int i = 0; i < arrSize; i++) {
gcStarts[i] = in.readLong();
}
arrSize = in.readInt();
gcFinishs = new long[arrSize];
for (int i = 0; i < arrSize; i++) {
gcFinishs[i] = in.readLong();
}
Arrays.sort(gcStarts);
Arrays.sort(gcFinishs);
serverState = in.readInt();
serverProgress = in.readInt();
}
示例8: readObject
import java.io.ObjectInputStream; //导入方法依赖的package包/类
private void readObject( ObjectInputStream in ) throws IOException, ClassNotFoundException {
final Serialization serialization = new Serialization();
// Create buckets
fpBits = in.readInt();
buckets = UnsafeBuckets.createBuckets( fpBits, in.readInt(), in.readLong(), in.readBoolean(), in.readLong() );
buckets.readMemory( in );
// Create kicked values
kickedValues = new KickedValues();
kickedValues.setKickedFingerprint( in.readInt() );
kickedValues.setKickedBucket( in.readLong() );
// Create bucket locker
final int concurrency = in.readInt();
bucketLocker = new BucketLocker( concurrency, concurrency );
// Create swapper
int maxKicks = in.readInt();
// Create random int provider
final byte randomIntType = in.readByte();
RandomInt randomInt;
if ( randomIntType > 0 ) {
randomInt = serialization.createRandomInt( randomIntType );
} else {
randomInt = (RandomInt) in.readObject();
}
swapper = new Swapper( kickedValues, bucketLocker, buckets, fpHasher, maxKicks, randomInt );
// Create string encoder
final byte stringEncoderType = in.readByte();
if ( stringEncoderType > 0 ) {
stringEncoder = serialization.createStringEncoder( stringEncoderType );
} else {
stringEncoder = (StringEncoder) in.readObject();
}
// Create bucket hasher
final byte bucketHasherType = in.readByte();
if ( bucketHasherType > 0 ) {
bucketHasher = serialization.createBucketHasher( bucketHasherType, in.readInt() );
} else {
bucketHasher = (BucketHasher) in.readObject();
}
// Create fingerprint hasher
final byte fpHasherType = in.readByte();
if ( fpHasherType > 0 ) {
fpHasher = serialization.createFingerprintHasher( fpHasherType );
} else {
fpHasher = (FingerprintHasher) in.readObject();
}
initialize();
}