@Override public long write(RandomAccessFile out) throws IOException, RcBwfException { long bytesWritten = super.write(out); out.write(this.data); bytesWritten += this.data.length; return bytesWritten; } }
@Override public long write(RandomAccessFile out) throws IOException, RcBwfException { // Write chunk id and chunk size long chunkHeaderSize = super.write(out); in.seek(this.getDataPointer()); byte buffer[] = new byte[1024]; int count; long bytesLeft = this.getChunkSize(); while (bytesLeft > 0) { count = this.in.read(buffer, 0, (int) Math.min((long) buffer.length, bytesLeft)); bytesLeft -= count; out.write(buffer, 0, count); } return chunkHeaderSize + this.getChunkSize(); }
@Override public long write(RandomAccessFile out) throws IOException, RcBwfException { if (this.getAXml().trim().length() == 0) { return 0L; } long chunkStartPtr = out.getFilePointer(); this.setChunkSize(0L); long chunkHeaderSize = super.write(out); long chunkDataSize = RcRiffFile.writeUtf8(out, this.getAXml().trim()); long chunkEndPtr = out.getFilePointer(); out.seek(chunkStartPtr + RcRiffChunk.SIZE_OF_CHUNK_ID); RcRiffFile.writeUnsignedInt(out, chunkDataSize); out.seek(chunkEndPtr); return chunkHeaderSize + chunkDataSize; }
@Override public long write(RandomAccessFile out) throws IOException, RcBwfException { this.setChunkSize(320 * this.getMarkerEntries().size()); long bytesWritten = super.write(out); for (RcRiffMarkerEntry e : this.rcRiffMarkerEntryList) { bytesWritten += e.write(out); } return bytesWritten; }
@Override public long write(RandomAccessFile out) throws IOException, RcBwfException { String exPrefix = "Unable to write RIFF header chunk - "; if (this.getFormat() == null) { throw new IOException( exPrefix + "format is null."); } if (this.getFormat().trim().length() != RcRiffHeaderChunk.FORMAT_LENGTH) { throw new IOException( exPrefix + "format length must be " + RcRiffHeaderChunk.FORMAT_LENGTH + " characters."); } // Write chunk id and chunk size long chunkHeaderSize = super.write(out); // Write format Long chunkDataSize = 0L; chunkDataSize += RcRiffFile.writeAscii(out, this.getFormat().trim()); return chunkHeaderSize + chunkDataSize; }
@Override public long write(RandomAccessFile out) throws IOException, RcBwfException { long bytesWritten = super.write(out); boolean valid = false; if (this.getListType().equals(RcRiffListChunk.RC_RIFF_INFO_LIST_TYPE)) { valid = true; } if (!valid) { throw new IOException(this.getListType() + " is not a valid LIST chunk type."); } bytesWritten += RcRiffFile.writeAscii(out, this.getListType()); return bytesWritten; }
@Override public long write(RandomAccessFile out) throws IOException, RcBwfException { if (this.getStoredMd5() == null || this.getStoredMd5().length == 0) { return 0L; } this.setChunkSize(this.getStoredMd5().length); long bytesWritten = super.write(out); out.write(this.reverse(this.getStoredMd5())); bytesWritten += this.getStoredMd5().length; return bytesWritten; }
long chunkHeaderSize = super.write(out);
long chunkHeaderSize = super.write(out);