Get the App
SLTechnology News&Howtos  ›  Development  › 

How to read Unicode and UTF-8 Encoding File in J2ME

Shulou Source: shulou.com Published: 2022-06-02 14:02:19 10月04日 Update

This article shows you how to read Unicode and UTF-8 encoded files in J2ME. The content is concise and easy to understand. It will definitely make your eyes shine. I hope you can gain something from the detailed introduction of this article.

J2ME has a more diverse environment and goals than J2SE and J2EE, but each product has a more singular purpose and stricter resource constraints.

Reading Unicode and UTF-8 encoded files in J2ME

J2ME reads Unicode files

/** * Read Unicode encoded text files *@paramresourceString-filename *@returnString-Unicode text */ publicstaticStringread_Uni(Stringresource){ byteword_uni[]=newbyte[1024]; StringStrReturn=null; InputStreamis; try{ is=instance.getClass().getResourceAsStream(resource); is.skip(2);//Skip two-byte headers is.read(word_uni); is.close(); StringBufferstringbuffer=newStringBuffer(""); for(intj=0;j

Tags: File UTF-8 coding text content skills file name knowledge jackers concise concise two product byte that is overall article method more environment Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB macOS Shulou Technology Docker NVidia