List of usage examples for java.io ObjectInputStream readInt
public int readInt() throws IOException
From source file:org.protempa.proposition.ProviderBasedLocalUniqueId.java
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { this.id = (String) s.readObject(); if (this.id == null) { throw new InvalidObjectException("Can't restore. Null id"); }/* w ww . j av a 2 s.c o m*/ this.numericalId = s.readInt(); }
From source file:net.sf.webissues.core.WebIssuesClientManager.java
public void readCache() { if (cacheFile == null || !cacheFile.exists()) { return;//from w w w .j av a2 s . c o m } ObjectInputStream in = null; try { in = new ObjectInputStream(new FileInputStream(cacheFile)); int size = in.readInt(); for (int i = 0; i < size; i++) { String url = (String) in.readObject(); WebIssuesClient data = (WebIssuesClient) in.readObject(); if (url != null && data != null) { clientByUrl.put(url, data); } } } catch (Throwable e) { e.printStackTrace(); StatusHandler.log(new Status(IStatus.WARNING, WebIssuesCorePlugin.ID_PLUGIN, "The WebIssues respository configuration cache could not be read", e)); } finally { if (in != null) { try { in.close(); } catch (IOException e) { // ignore } } } }
From source file:org.pentaho.reporting.libraries.designtime.swing.SerializedObjectContainer.java
private void readObject(final ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject();//from w w w .j a v a2 s . com final Class arrayType = (Class) stream.readObject(); final int count = stream.readInt(); data = (Object[]) Array.newInstance(arrayType, count); for (int i = 0; i < count; i++) { final int index = stream.readInt(); if (index != -1) { data[i] = stream.readObject(); } } }
From source file:pt.webdetails.cda.cache.monitor.ExtraCacheInfo.java
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { cdaSettingsId = (String) in.readObject(); dataAccessId = (String) in.readObject(); queryDurationMs = in.readLong();// www . jav a 2 s .co m nbrRows = in.readInt(); entryTime = in.readLong(); timeToLive = in.readInt(); try { tableSnapshot = new JSONObject((String) in.readObject()); } catch (Exception e) { tableSnapshot = null; } }
From source file:ConcurrentHashSet.java
/** * Re-constitute the <tt>HashSet</tt> instance from a stream. * //from w w w. j a v a 2 s .c om * @param inputStream * @throws ClassNotFoundException * @throws IOException */ private void readObject(ObjectInputStream inputStream) throws ClassNotFoundException, IOException { inputStream.defaultReadObject(); map = new ConcurrentHashMap<E, Object>(); int size = inputStream.readInt(); for (int i = 0; i < size; i++) { E e = (E) inputStream.readObject(); map.put(e, PRESENT); } }
From source file:com.hp.autonomy.hod.client.api.textindex.query.search.Document.java
private void readObject(final ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException { objectInputStream.defaultReadObject(); fields = new HashMap<>(); final int fieldCount = objectInputStream.readInt(); for (int i = 0; i < fieldCount; i++) { final String fieldName = (String) objectInputStream.readObject(); final Serializable value = (Serializable) objectInputStream.readObject(); fields.put(fieldName, value);/*from w w w . j ava 2 s.c om*/ } // For backwards compatibility of serialized form if (promotionType == null) { promotionType = PromotionType.NONE; } }
From source file:jopt.csp.util.SortableIntList.java
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject();//www .j av a2s .c o m data = new int[in.readInt()]; for (int i = 0; i < size; i++) { data[i] = in.readInt(); } }
From source file:IntArrayList.java
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject();//www . java 2s .c om array = new int[in.readInt()]; for (int i = 0; i < size; i++) { array[i] = in.readInt(); } }
From source file:CharArrayList.java
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject();/* ww w. j av a 2 s . c o m*/ array = new char[in.readInt()]; for (int i = 0; i < size; i++) { array[i] = in.readChar(); } }
From source file:ByteArrayList.java
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject();//from w ww. ja v a2 s.c om array = new byte[in.readInt()]; for (int i = 0; i < size; i++) { array[i] = in.readByte(); } }