package com.nulabinc.backlog4j.internal.json;

import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.TimeZone;

/**
 * @author nulab-inc
 */
public abstract class AbstractJSONImplTest {

    protected InternalFactoryJSONImpl factory = new InternalFactoryJSONImpl();
    protected TimeZone timeZone = TimeZone.getTimeZone("Asia/Tokyo") ;

    protected String getJsonString(String resourceFilePath) throws IOException {
        String fileName = SpaceJSONImplTest.class.getClassLoader().getResource(resourceFilePath).getPath();

        byte[] fileContentBytes = Files.readAllBytes(Paths.get(fileName));
        String fileContentStr = new String(fileContentBytes, StandardCharsets.UTF_8);
        return fileContentStr;
    }
}

@@ -59,61 +59,23 @@
 .io.
-IOException;%0Aimport java.nio.charset.StandardCharsets
+CharArrayWriter
 ;%0Aim
@@ -88,22 +88,22 @@
 ava.
-n
 io.
-file.Files
+IOException
 ;%0Aim
@@ -116,22 +116,28 @@
 ava.
-n
 io.
-file.Paths
+InputStreamReader
 ;%0Aim
@@ -384,17 +384,16 @@
 /Tokyo%22)
- 
 ;%0A%0A    p
@@ -480,52 +480,120 @@
     
-String fileName = SpaceJSONImplTest.class.ge
+InputStreamReader r = null;%0A        try %7B%0A            r = new InputStreamReader(Thread.currentThread().getContex
 tCla
@@ -614,16 +614,24 @@
 Resource
+AsStream
 (resourc
@@ -644,29 +644,90 @@
 ath)
-.getPath
+, %22UTF-8%22);%0A            CharArrayWriter writer = new CharArrayWriter
 ();%0A
-%0A
+  
         
 byte
@@ -726,191 +726,306 @@
     
-byte%5B%5D fileContentBytes = Files.readAllBytes(Paths.get(fileName));%0A        String fileContentStr = new String(fileContentBytes, StandardCharsets.UTF_8);%0A        return fileContentStr;
+  char buff%5B%5D = new char%5B4096%5D;%0A            int size;%0A            while ((size = r.read(buff)) %3E 0) %7B%0A                writer.write(buff, 0, size);%0A            %7D%0A            return writer.toString();%0A        %7D finally %7B%0A            if (r != null) %7B%0A                r.close();%0A            %7D%0A        %7D
 %0A   

Fix to work in Windows