本文整理匯總了Java中java.io.DataInput.readFloat方法的典型用法代碼示例。如果您正苦於以下問題:Java DataInput.readFloat方法的具體用法?Java DataInput.readFloat怎麽用?Java DataInput.readFloat使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.io.DataInput
的用法示例。
在下文中一共展示了DataInput.readFloat方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: readFields
import java.io.DataInput; //導入方法依賴的package包/類
public void readFields(DataInput in) throws IOException {
this.taskid.readFields(in);
this.progress = in.readFloat();
this.state = StringInterner.weakIntern(Text.readString(in));
this.startTime = in.readLong();
this.finishTime = in.readLong();
diagnostics = WritableUtils.readStringArray(in);
counters = new Counters();
counters.readFields(in);
currentStatus = WritableUtils.readEnum(in, TIPStatus.class);
if (currentStatus == TIPStatus.RUNNING) {
int num = WritableUtils.readVInt(in);
for (int i = 0; i < num; i++) {
TaskAttemptID t = new TaskAttemptID();
t.readFields(in);
runningAttempts.add(t);
}
} else if (currentStatus == TIPStatus.COMPLETE) {
successfulAttempt.readFields(in);
}
}
示例2: readFloatArray
import java.io.DataInput; //導入方法依賴的package包/類
/**
* Reads an array of <code>float</code>s from a <code>DataInput</code>.
*
* @throws IOException A problem occurs while reading from <code>in</code>
*
* @see #writeFloatArray
*/
public static float[] readFloatArray(DataInput in) throws IOException {
InternalDataSerializer.checkIn(in);
int length = InternalDataSerializer.readArrayLength(in);
if (length == -1) {
return null;
} else {
float[] array = new float[length];
for (int i = 0; i < length; i++) {
array[i] = in.readFloat();
}
if (logger.isTraceEnabled(LogMarker.SERIALIZER)) {
logger.trace(LogMarker.SERIALIZER, "Read float array of length {}", length);
}
return array;
}
}
示例3: read
import java.io.DataInput; //導入方法依賴的package包/類
/** Implements the reader half of the Externalizable interface
@param in the ObjectInput interface
*/
public void read(DataInput in) throws IOException {
contents=in.readInt();
sequenceNumber=in.readInt();
timeCapturedMs=in.readLong();
globalX=in.readFloat();
globalY=in.readFloat();
read2DArray(in,ph);
read2DArray(in,ux);
read2DArray(in,uy);
rawDataPixel=new float[getNumLocalChannels()][chip.NUM_ROWS][chip.NUM_COLUMNS];
for(int i=0;i<getNumLocalChannels();i++){
read2DArray(in,rawDataPixel[i]);
}
}
示例4: read2DArray
import java.io.DataInput; //導入方法依賴的package包/類
private void read2DArray(DataInput in, float[][] f) throws IOException {
for(int i=0;i<f.length;i++){
float[] g=f[i];
for(int j=0;j<g.length;j++){
g[j]=in.readFloat();
}
}
}
示例5: readPrimitiveFloat
import java.io.DataInput; //導入方法依賴的package包/類
/**
* Reads a primitive <code>float</code> from a <code>DataInput</code>.
*
* @throws IOException A problem occurs while reading from <code>in</code>
* @see DataInput#readFloat
* @since GemFire 5.1
*/
public static float readPrimitiveFloat(DataInput in) throws IOException {
InternalDataSerializer.checkIn(in);
float value = in.readFloat();
if (logger.isTraceEnabled(LogMarker.SERIALIZER)) {
logger.trace(LogMarker.SERIALIZER, "Read Float {}", value);
}
return value;
}
示例6: read
import java.io.DataInput; //導入方法依賴的package包/類
@Override
public void read(DataInput stream) throws Exception{
this.data = stream.readFloat();
}
示例7: readFloatArray
import java.io.DataInput; //導入方法依賴的package包/類
private void readFloatArray(DataInput in) throws IOException {
float[] v = (float[]) value;
for (int i = 0; i < length; i++)
v[i] = in.readFloat();
}
示例8: readStream
import java.io.DataInput; //導入方法依賴的package包/類
@Override
public Float readStream(final DataInput data)
throws IOException
{
return data.readFloat();
}
示例9: ConstantPool
import java.io.DataInput; //導入方法依賴的package包/類
ConstantPool(DataInput in) throws IOException {
int count = in.readUnsignedShort();
pool = new Entry[count];
for (int i = 1; i < count; i++) {
int tag = in.readUnsignedByte();
switch (tag) {
case CONSTANT_Utf8:
String svalue = in.readUTF();
pool[i] = new ValueEntry(tag, svalue);
break;
case CONSTANT_Class:
case CONSTANT_Package:
case CONSTANT_Module:
case CONSTANT_String:
int index = in.readUnsignedShort();
pool[i] = new IndexEntry(tag, index);
break;
case CONSTANT_Double:
double dvalue = in.readDouble();
pool[i] = new ValueEntry(tag, dvalue);
i++;
break;
case CONSTANT_Fieldref:
case CONSTANT_InterfaceMethodref:
case CONSTANT_Methodref:
case CONSTANT_InvokeDynamic:
case CONSTANT_NameAndType:
int index1 = in.readUnsignedShort();
int index2 = in.readUnsignedShort();
pool[i] = new Index2Entry(tag, index1, index2);
break;
case CONSTANT_MethodHandle:
int refKind = in.readUnsignedByte();
index = in.readUnsignedShort();
pool[i] = new Index2Entry(tag, refKind, index);
break;
case CONSTANT_MethodType:
index = in.readUnsignedShort();
pool[i] = new IndexEntry(tag, index);
break;
case CONSTANT_Float:
float fvalue = in.readFloat();
pool[i] = new ValueEntry(tag, fvalue);
break;
case CONSTANT_Integer:
int ivalue = in.readInt();
pool[i] = new ValueEntry(tag, ivalue);
break;
case CONSTANT_Long:
long lvalue = in.readLong();
pool[i] = new ValueEntry(tag, lvalue);
i++;
break;
default:
throw invalidModuleDescriptor("Bad constant pool entry: "
+ i);
}
}
}
示例10: read
import java.io.DataInput; //導入方法依賴的package包/類
void read(DataInput input, int depth, NBTSizeTracker sizeTracker) throws IOException
{
sizeTracker.read(96L);
this.data = input.readFloat();
}
示例11: fromData
import java.io.DataInput; //導入方法依賴的package包/類
public void fromData(DataInput in) throws IOException, ClassNotFoundException {
this.cacheLoaderDesc = DataSerializer.readString(in);
this.cacheWriterDesc = DataSerializer.readString(in);
this.cacheListenerDescs = DataSerializer.readStringArray(in);
this.capacityControllerDesc = DataSerializer.readString(in);
this.keyConstraint = (Class) DataSerializer.readObject(in);
this.valueConstraint = (Class) DataSerializer.readObject(in);
this.rTtl = (ExpirationAttributes) DataSerializer.readObject(in);
this.rIdleTimeout = (ExpirationAttributes) DataSerializer.readObject(in);
this.eTtl = (ExpirationAttributes) DataSerializer.readObject(in);
this.customEttlDesc = DataSerializer.readString(in);
this.eIdleTimeout = (ExpirationAttributes) DataSerializer.readObject(in);
this.customEIdleDesc = DataSerializer.readString(in);
this.dataPolicy = (DataPolicy) DataSerializer.readObject(in);
this.scope = (Scope) DataSerializer.readObject(in);
this.statsEnabled = in.readBoolean();
this.ignoreJTA = in.readBoolean();
this.concurrencyLevel = in.readInt();
this.loadFactor = in.readFloat();
this.initialCapacity = in.readInt();
this.earlyAck = in.readBoolean();
this.multicastEnabled = in.readBoolean();
this.enableSubscriptionConflation = in.readBoolean();
this.publisher = in.readBoolean();
this.enableAsyncConflation = in.readBoolean();
this.diskWriteAttributes = (DiskWriteAttributes) DataSerializer.readObject(in);
this.diskDirs = (File[]) DataSerializer.readObject(in);
this.diskSizes = (int[]) DataSerializer.readObject(in);
this.indexMaintenanceSynchronous = in.readBoolean();
this.partitionAttributes = (PartitionAttributes) DataSerializer.readObject(in);
this.membershipAttributes = (MembershipAttributes) DataSerializer.readObject(in);
this.subscriptionAttributes = (SubscriptionAttributes) DataSerializer.readObject(in);
this.evictionAttributes = (EvictionAttributesImpl) DataSerializer.readObject(in);
this.cloningEnable = in.readBoolean();
this.diskStoreName = DataSerializer.readString(in);
this.isDiskSynchronous = in.readBoolean();
this.gatewaySendersDescs = DataSerializer.readStringArray(in);
this.isGatewaySenderEnabled = in.readBoolean();
this.concurrencyChecksEnabled = in.readBoolean();
this.compressorDesc = DataSerializer.readString(in);
this.offHeap = in.readBoolean();
this.customAttributes = DataSerializer.readObject(in);
this.regionMapFactory = DataSerializer.readString(in);
}
示例12: fromData
import java.io.DataInput; //導入方法依賴的package包/類
@Override
public void fromData(DataInput in) throws IOException, ClassNotFoundException {
timeInMillis = in.readFloat();
numResults = in.readInt();
indexesUsed = DataSerializer.readString(in);
}
示例13: fromData
import java.io.DataInput; //導入方法依賴的package包/類
public void fromData(DataInput in) throws IOException, ClassNotFoundException {
connectionLoad = in.readFloat();
loadPerConnection = in.readFloat();
subscriberLoad = in.readFloat();
loadPerSubscriber = in.readFloat();
}
示例14: fromData
import java.io.DataInput; //導入方法依賴的package包/類
/**
* Generate a Thresholds object from data available from the DataInput
*
* @param in DataInput from which to read the data
* @return a new instance of Thresholds
* @throws IOException
*/
public static MemoryThresholds fromData(DataInput in) throws IOException {
long maxMemoryBytes = in.readLong();
float criticalThreshold = in.readFloat();
float evictionThreshold = in.readFloat();
return new MemoryThresholds(maxMemoryBytes, criticalThreshold, evictionThreshold);
}
示例15: ConstantFloat
import java.io.DataInput; //導入方法依賴的package包/類
/**
* Initialize instance from file data.
*
* @param file
* Input stream
* @throws IOException
*/
ConstantFloat(final DataInput file) throws IOException {
super(Const.CONSTANT_Float);
this.bytes = file.readFloat();
}