Skip to content

miktim/BOMio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

# Java SE 7+ Byte Order Mark (BOM) Readers/Writers. MIT (c) 2022 miktim@mail.ru

Release notes:
  See: https://en.wikipedia.org/wiki/Byte_order_mark
       https://docs.oracle.com/javase/7/docs/technotes/guides/intl/encoding.doc.html
       RFC 2781, RFC 3629
       
package org.miktim.io;

Overview:

  Class BomTable;
    Build-in encoders: UTF-8, UTF-16BE(UTF-16), UTF-16LE, UTF-32BE(UTF-32), UTF-32LE, GB1803
    Note: Java UTF-16 output stream writer is in real the UTF-16BE BOM writer.

    Methods:
      static void addBom(String charsetName, byte[] bomPrefix)
      static String[] listEncoders(); 
      
  Class BomInputStreamReader extends Reader;
    Constructor:
      BomInputStreamReader(InputStream in) throws IOException;

    Methods:
      all methods inherited from java.io.Reader;
      String getEncoding();
      String getEncoder();

  Class BomOutputStreamWriter extends Writer;
    Constructor:
      BomOutputStreamWriter(OutputStream out, String charsetName) throws IOException;

    Methods:
      all methods inherited from java.io.Writer;
      String getEncoding();
      String getEncoder();

      
  Class BomFileReader extends BomInputStreamReader;
    Constructors:
      BomFileReader(File file) throws IOException;
      BomFileReader(String fileName) throws IOException;

    Methods:
      all methods inherited from BomInputStreamReader;

  Class BomFileWriter extends BomOutputStreamWriter;
    Constructors:
      BomFileWriter(File file, String charsetName) throws IOException;
      BomFileWriter(String fileName, String charsetName) throws IOException;

    Methods:
      all methods inherited from BomOutputStreamWriter;

Usage:
  See ./test/bomio/BomIoTest.java  (test requires JDK 8 and higher)

About

Java SE 7+ detector/reader or writer Byte Order Mark (BOM) files

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors