In Java , Exclude a string while encode using base64

╄→гoц情女王★ 提交于 2019-12-12 04:21:40

问题


Is there a way that I can exclude particular string (II*) while encode a tiff file and keep that String as it is and also during the decode ?

Or

How can I specify the encoding to always encode (II*) as three characters and not to combine with any other characters ?

Below code to replace the string II* with ( II* ), however tiff got corrupted after that.

           Path path = Paths.get("D:\\Users\\Vinoth\\workspace\\Testing\\Testing.tiff");
            Charset charset = StandardCharsets.UTF_8;

            String content = new String(Files.readAllBytes(path), charset);
            content = content.replace("II*", "  II  ");
            content = content.replace("  II  ","  II*  ");
            Files.write(path, content.getBytes(charset));

来源:https://stackoverflow.com/questions/38431971/in-java-exclude-a-string-while-encode-using-base64

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!