src/main/java/ubu/digit/persistence/BOMRemoveUTF.java
public  void bomRemoveUTF(byte[] buffer, String fileStrPath) throws FileNotFoundException, IOException{
		RandomAccessFile file = new RandomAccessFile(fileStrPath,"rw");
		file.read(buffer);
		if (hasBom(buffer)){
			int inputSize = (int)file.length();
			byte[] bufferWithoutBom = new byte[inputSize-3];
			file.read(bufferWithoutBom,0,inputSize-3);
			file.seek(0);
			file.write(bufferWithoutBom, 0, inputSize-3);
			file.setLength(inputSize-3);
		}
		file.close();
	}
/**
	 * Elimina el caracter unicode character BOM (Byte Order Mark) del comienzo del fichero.
	 * @param buffer
	 * @throws FileNotFoundException
	 * @throws IOException
	 */
Elimina el caracter unicode character BOM (Byte Order Mark) del comienzo del fichero.
Elimina el caracter unicode character BOM ( Byte Order Mark ) del comienzo del fichero .
public  void bomRemoveUTF(byte[] buffer, String fileStrPath) throws FileNotFoundException, IOException{
		RandomAccessFile file = new RandomAccessFile(fileStrPath,"rw");
		file.read(buffer);
		if (hasBom(buffer)){
			int inputSize = (int)file.length();
			byte[] bufferWithoutBom = new byte[inputSize-3];
			file.read(bufferWithoutBom,0,inputSize-3);
			file.seek(0);
			file.write(bufferWithoutBom, 0, inputSize-3);
			file.setLength(inputSize-3);
		}
		file.close();
	}
public void bomRemoveUTF ( byte [ ] buffer , String fileStrPath ) throws FileNotFoundException , IOException { RandomAccessFile file = new RandomAccessFile ( fileStrPath , "rw" ) ; file . read ( buffer ) ; if ( hasBom ( buffer ) ) { int inputSize = ( int ) file . length ( ) ; byte [ ] bufferWithoutBom = new byte [ inputSize - 3 ] ; file . read ( bufferWithoutBom , 0 , inputSize - 3 ) ; file . seek ( 0 ) ; file . write ( bufferWithoutBom , 0 , inputSize - 3 ) ; file . setLength ( inputSize - 3 ) ; } file . close ( ) ; }
Elimina el caracter unicode character BOM (Byte Order Mark) del comienzo del fichero.
Elimina el caracter unicode character BOM ( Byte Order Mark ) del comienzo del fichero .