File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
src/com/cedricziel/idea/typo3/index/externalizer Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .cedricziel .idea .typo3 .index .externalizer ;
2+
3+ import com .intellij .util .io .DataExternalizer ;
4+ import com .intellij .util .io .EnumeratorStringDescriptor ;
5+ import gnu .trove .THashSet ;
6+ import java .io .DataInput ;
7+ import java .io .DataOutput ;
8+ import java .io .IOException ;
9+ import java .util .Iterator ;
10+ import java .util .Set ;
11+ import org .jetbrains .annotations .NotNull ;
12+
13+ public class StringSetDataExternalizer implements DataExternalizer <Set <String >> {
14+ public StringSetDataExternalizer () {
15+ }
16+
17+ public synchronized void save (@ NotNull DataOutput out , Set <String > value ) throws IOException {
18+ out .writeInt (value .size ());
19+ Iterator var3 = value .iterator ();
20+
21+ while (var3 .hasNext ()) {
22+ String s = (String )var3 .next ();
23+ EnumeratorStringDescriptor .INSTANCE .save (out , s );
24+ }
25+
26+ }
27+
28+ public synchronized Set <String > read (@ NotNull DataInput in ) throws IOException {
29+ THashSet set = new THashSet ();
30+
31+ for (int r = in .readInt (); r > 0 ; --r ) {
32+ set .add (EnumeratorStringDescriptor .INSTANCE .read (in ));
33+ }
34+
35+ return set ;
36+ }
37+ }
You can’t perform that action at this time.
0 commit comments