List of usage examples for java.io ObjectInput readInt
int readInt() throws IOException;
From source file:xbird.xquery.expr.func.FunctionCall.java
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { this._type = (Type) in.readObject(); this._funcName = QualifiedName.readFrom(in); final int numParams = in.readInt(); final ArrayList<XQExpression> params = new ArrayList<XQExpression>(numParams); for (int i = 0; i < numParams; i++) { XQExpression e = (XQExpression) in.readObject(); params.add(e);//w w w.j a v a2 s. c o m } this._params = params; }
From source file:xbird.xquery.expr.opt.ShippedVariable.java
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { this._local = false; this._type = (Type) in.readObject(); this._varName = (QualifiedName) in.readObject(); this._identifier = in.readInt(); final boolean hasResult = in.readBoolean(); if (hasResult) { final boolean isRemoteSeq = in.readBoolean(); if (isRemoteSeq) { this._result = RemoteSequence.readFrom(in); } else {//from w ww. jav a 2 s . com final StopWatch sw = new StopWatch("Elapsed time for decoding `$" + getName() + '\''); final XQEventDecoder decoder = new XQEventDecoder(in); try { this._result = decoder.decode(); } catch (XQueryException xqe) { throw new IllegalStateException("failed decoding `$" + getName() + '\'', xqe); } catch (Throwable e) { throw new IllegalStateException("failed decoding `$" + getName() + '\'', e); } if (LOG.isInfoEnabled()) { LOG.info(sw); } } } else { this._value = (XQExpression) in.readObject(); } }
From source file:xbird.storage.io.RemoteVarSegments.java
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { String host = IOUtils.readString(in); int port = in.readInt(); this._sockAddr = new InetSocketAddress(host, port); this._filePath = IOUtils.readString(in); }
From source file:xbird.util.nio.RemoteMemoryMappedFile.java
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { this._bigEndian = in.readBoolean(); this._pageSize = in.readInt(); this._maxBulkFetchSize = _pageSize * (MemoryMappedDocumentTable.CACHED_PAGES / 4); this._rcvbuf = ByteBuffer.allocateDirect(_pageSize); String host = IOUtils.readString(in); int port = in.readInt(); this._sockAddr = new InetSocketAddress(host, port); this._filePath = IOUtils.readString(in); this._fileIdentifier = generateFileIdentifier(_sockAddr, _filePath); }
From source file:org.nuxeo.ecm.platform.ui.web.component.list.StampState.java
@Override @SuppressWarnings("unchecked") public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { int size = in.readInt(); if (size > 0) { rows = (Map<DualKey, Object>) in.readObject(); }/*from ww w .j av a2 s. c o m*/ if (log.isDebugEnabled()) { for (Map.Entry<DualKey, Object> entry : rows.entrySet()) { log.debug("Restoring " + entry.getKey() + ", " + entry.getValue()); } } }
From source file:gridool.db.DBInsertOperation.java
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { super.readExternal(in); this.createTableDDL = IOUtils.readString(in); this.tableName = IOUtils.readString(in); final int numFields = in.readInt(); final String[] fn; if (numFields == 0) { fn = null;//from www. java2 s . c o m } else { fn = new String[numFields]; for (int i = 0; i < numFields; i++) { fn[i] = IOUtils.readString(in); } } this.fieldNames = fn; final int numRecords = in.readInt(); final DBRecord[] r = new DBRecord[numRecords]; for (int i = 0; i < numRecords; i++) { r[i] = (DBRecord) in.readObject(); } this.records = r; }
From source file:com.splicemachine.orc.predicate.SpliceORCPredicate.java
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { baseColumnMap = ArrayUtil.readIntArray(in); if (in.readBoolean()) { qualifiers = new Qualifier[in.readInt()][]; qualifiers[0] = new Qualifier[in.readInt()]; for (int i = 0; i < qualifiers[0].length; i++) { qualifiers[0][i] = (Qualifier) in.readObject(); }//w w w . j ava 2 s . com for (int and_idx = 1; and_idx < qualifiers.length; and_idx++) { qualifiers[and_idx] = new Qualifier[in.readInt()]; for (int or_idx = 0; or_idx < qualifiers[and_idx].length; or_idx++) { qualifiers[and_idx][or_idx] = (Qualifier) in.readObject(); } } } structType = (StructType) StructType.fromJson((String) in.readObject()); }
From source file:org.openspaces.remoting.ExecutorRemotingTask.java
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { lookupName = in.readUTF();//from w ww. j a v a2 s. co m methodName = in.readUTF(); int size = in.readInt(); if (size > 0) { arguments = new Object[size]; for (int i = 0; i < size; i++) { arguments[i] = in.readObject(); } } size = in.readInt(); if (size > 0) { metaArguments = new Object[size]; for (int i = 0; i < size; i++) { metaArguments[i] = in.readObject(); } } methodHash = new RemotingUtils.MethodHash(); methodHash.readExternal(in); }
From source file:gridool.routing.strategy.ConsistentHash.java
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { HashFunction hashFunc = (HashFunction) in.readObject(); this.hashFunction = hashFunc; this.numberOfVirtualNodes = in.readInt(); this.circle = new TreeMap<Long, GridNode>(); this.liveNodes = new TreeMap<GridNode, GridNode>(new NodeComparator(hashFunc)); this.removedNodes = new HashMap<GridNode, GridNode>(32); final int numNodes = in.readInt(); for (int i = 0; i < numNodes; i++) { GridNode node = (GridNode) in.readObject(); add(node);/* w w w . j a va2 s. c o m*/ } final int numRemoved = in.readInt(); final Map<GridNode, GridNode> removedNodes = new HashMap<GridNode, GridNode>(numRemoved * 2); for (int i = 0; i < numRemoved; i++) { GridNode node = (GridNode) in.readObject(); removedNodes.put(node, node); } this.removedNodes = removedNodes; }
From source file:hivemall.fm.FFMPredictionModel.java
@Override public void readExternal(@Nonnull final ObjectInput in) throws IOException, ClassNotFoundException { this._w0 = in.readDouble(); final int factors = in.readInt(); this._factors = factors; this._numFeatures = in.readInt(); this._numFields = in.readInt(); final int used = in.readInt(); final int size = in.readInt(); final int[] keys = new int[size]; final long[] values = new long[size]; final byte[] states = new byte[size]; readStates(in, states);/*w w w . ja v a 2 s . c om*/ final int entrySize = Entry.sizeOf(factors); int numChunks = (entrySize * used) / HeapBuffer.DEFAULT_CHUNK_BYTES + 1; final HeapBuffer buf = new HeapBuffer(HeapBuffer.DEFAULT_CHUNK_SIZE, numChunks); final Entry e = new Entry(buf, factors); final float[] Vf = new float[factors]; for (int i = 0; i < size; i++) { if (states[i] != IntOpenHashTable.FULL) { continue; } keys[i] = ZigZagLEB128Codec.readSignedInt(in); long ptr = buf.allocate(entrySize); e.setOffset(ptr); readEntry(in, factors, Vf, e); values[i] = ptr; } this._map = new Int2LongOpenHashTable(keys, values, states, used); this._buf = buf; }