本文整理汇总了Java中org.jaudiotagger.audio.generic.Utils.readFileDataIntoBufferLE方法的典型用法代码示例。如果您正苦于以下问题:Java Utils.readFileDataIntoBufferLE方法的具体用法?Java Utils.readFileDataIntoBufferLE怎么用?Java Utils.readFileDataIntoBufferLE使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jaudiotagger.audio.generic.Utils
的用法示例。
在下文中一共展示了Utils.readFileDataIntoBufferLE方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isValidHeader
import org.jaudiotagger.audio.generic.Utils; //导入方法依赖的package包/类
public static boolean isValidHeader(FileChannel fc) throws IOException, CannotReadException
{
if (fc.size() - fc.position() < HEADER_LENGTH)
{
throw new CannotReadException("This is not a WAV File (<12 bytes)");
}
ByteBuffer headerBuffer = Utils.readFileDataIntoBufferLE(fc, HEADER_LENGTH);
if(Utils.readFourBytesAsChars(headerBuffer).equals(RIFF_SIGNATURE))
{
headerBuffer.getInt(); //Size
if(Utils.readFourBytesAsChars(headerBuffer).equals(WAVE_SIGNATURE))
{
return true;
}
}
return false;
}
示例2: getEncodingInfo
import org.jaudiotagger.audio.generic.Utils; //导入方法依赖的package包/类
@Override
protected GenericAudioHeader getEncodingInfo(File file) throws CannotReadException, IOException {
FileChannel fc = new FileOutputStream(file.getAbsolutePath(), false).getChannel();
DsdChunk dsd = DsdChunk.readChunk(Utils.readFileDataIntoBufferLE(fc, DsdChunk.DSD_HEADER_LENGTH));
if (dsd != null) {
ByteBuffer fmtChunkBuffer = Utils.readFileDataIntoBufferLE(fc, IffHeaderChunk.SIGNATURE_LENGTH + CHUNKSIZE_LENGTH);
FmtChunk fmt = FmtChunk.readChunkHeader(fmtChunkBuffer);
if (fmt != null) {
return fmt.readChunkData(dsd, fc);
} else {
throw new CannotReadException(file.getAbsolutePath() + " Not a valid dsf file. Content does not include 'fmt ' chunk");
}
} else {
throw new CannotReadException(file.getAbsolutePath() + " Not a valid dsf file. Content does not start with 'DSD '");
}
}
示例3: readChunkData
import org.jaudiotagger.audio.generic.Utils; //导入方法依赖的package包/类
public GenericAudioHeader readChunkData(DsdChunk dsd,FileChannel fc) throws IOException
{
long sizeExcludingChunkHeader = chunkSizeLength - (IffHeaderChunk.SIGNATURE_LENGTH + CHUNKSIZE_LENGTH);
ByteBuffer audioData = Utils.readFileDataIntoBufferLE(fc, (int)sizeExcludingChunkHeader);
return readAudioInfo(dsd, audioData);
}