java.io.ByteArrayInputStream



API Populatity

280 Client projects

Project: java

Package: java.io

Project JetBrains/intellij-community in file ...roid.src.org.jetbrains.android.AndroidIdIndex.java (2012-05-03)
@@ -30,7 +30,6 @@ import com.intellij.util.xml.NanoXmlUtil;
 import org.jetbrains.android.util.AndroidResourceUtil;
 import org.jetbrains.annotations.NotNull;
 
-import java.io.ByteArrayInputStream;
 import java.util.Collections;
 import java.util.Map;
 
@@ -61,7 +60,7 @@ public class AndroidIdIndex extends ScalarIndexExtension<String> {
       }
       final HashMap<String, Void> ids = new HashMap<String, Void>();
       
-      NanoXmlUtil.parse(new ByteArrayInputStream(inputData.getContent()), new NanoXmlUtil.IXMLBuilderAdapter() {
+      NanoXmlUtil.parse(CharArrayUtil.readerFromCharSequence(inputData.getContentAsText()), new NanoXmlUtil.IXMLBuilderAdapter() {
         @Override
         public void addAttribute(String key, String nsPrefix, String nsURI, String value, String type) throws Exception {
           super.addAttribute(key, nsPrefix, nsURI, value, type);
Project JetBrains/intellij-community in file ....jetbrains.android.AndroidValueResourcesIndex.java (2012-05-03)
@@ -16,7 +16,6 @@ import org.jetbrains.android.util.ValueResourcesFileParser;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
-import java.io.ByteArrayInputStream;
 import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
@@ -49,7 +48,7 @@ public class AndroidValueResourcesIndex extends FileBasedIndexExtension<Resource
         }
         final Map<ResourceEntry, Set<ResourceEntry>> result = new HashMap<ResourceEntry, Set<ResourceEntry>>();
 
-        NanoXmlUtil.parse(new ByteArrayInputStream(inputData.getContent()), new ValueResourcesFileParser() {
+        NanoXmlUtil.parse(CharArrayUtil.readerFromCharSequence(inputData.getContentAsText()), new ValueResourcesFileParser() {
           @Override
           protected void stop() {
             throw new NanoXmlUtil.ParserStoppedException();
Project JetBrains/intellij-community in file ...mpl.src.com.intellij.xml.index.XmlSchemaIndex.java (2008-04-23)
@@ -10,6 +10,7 @@ import org.jetbrains.annotations.NonNls;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Map;
+import java.io.ByteArrayInputStream;
 
 /**
  * @author Dmitry Avdeev
@@ -26,7 +27,7 @@ public class XmlSchemaIndex extends ScalarIndexExtension<String> {
   public DataIndexer<String, Void, FileContent> getIndexer() {
     return new DataIndexer<String, Void, FileContent>() {
       public Map<String, Void> map(final FileContent inputData) {
-        final Collection<String> tags = XsdTagNameBuilder.computeTagNames(inputData.getFile());
+        final Collection<String> tags = XsdTagNameBuilder.computeTagNames(new ByteArrayInputStream(inputData.getContent()));
         if (tags != null && !tags.isEmpty()) {
           final HashMap<String, Void> map = new HashMap<String, Void>(tags.size());
           for (String tag : tags) {