Browse Source

//vodeo

private_deployment
xhxu 2 years ago
parent
commit
111f4637c0
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      suimangVideo/src/main/java/com/iformall/language/LanguageDetect.java

+ 4
- 1
suimangVideo/src/main/java/com/iformall/language/LanguageDetect.java View File

@@ -8,10 +8,12 @@ import lombok.extern.slf4j.Slf4j;
import lombok.var; import lombok.var;
import org.springframework.core.io.Resource; import org.springframework.core.io.Resource;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver; import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.util.StreamUtils;
import sun.misc.IOUtils; import sun.misc.IOUtils;


import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;


@@ -30,7 +32,8 @@ public class LanguageDetect {
Resource[] resources = resolver.getResources("classpath:profiles/*"); Resource[] resources = resolver.getResources("classpath:profiles/*");
for (Resource resource:resources) { for (Resource resource:resources) {
InputStream inputStream = resource.getInputStream(); InputStream inputStream = resource.getInputStream();
String str = new String(ByteStreams.toByteArray(inputStream));
String str = StreamUtils.copyToString(inputStream, StandardCharsets.UTF_8);
// String str = new String(ByteStreams.toByteArray(inputStream));
profile.add(str); profile.add(str);
} }
} catch (IOException e) { } catch (IOException e) {


Loading…
Cancel
Save