Bitstream bitstream = new Bitstream(inputStream); Decoder decoder = new Decoder();
@Override public Bitstream create(Context context, InputStream is) throws IOException, SQLException { // Store the bits UUID bitstreamID = bitstreamStorageService.store(context, bitstreamDAO.create(context, new Bitstream()), is); log.info(LogManager.getHeader(context, "create_bitstream", "bitstream_id=" + bitstreamID)); // Set the format to "unknown" Bitstream bitstream = find(context, bitstreamID); setFormat(context, bitstream, null); context.addEvent( new Event(Event.CREATE, Constants.BITSTREAM, bitstreamID, null, getIdentifiers(context, bitstream))); return bitstream; }
try Bitstream m_bitstream = new Bitstream(pis); aff_properties.put("mp3.header.pos", new Integer(m_bitstream.header_pos())); Header m_header = m_bitstream.readFrame();
.openConnection() .getInputStream(); final Bitstream bitstream = new Bitstream(in);
InputStream inputStream = new BufferedInputStream(new FileInputStream(file), 8 * 1024); try { Bitstream bitstream = new Bitstream(inputStream); Decoder decoder = new Decoder();
Bitstream bitstream = new Bitstream(is);
Bitstream bitstream = new Bitstream(in); Decoder decoder = new Decoder();
throws IOException, SQLException, AuthorizeException { Bitstream bitstream = bitstreamDAO.create(context, new Bitstream()); bitstreamStorageService.register( context, bitstream, assetstore, bitstreamPath);
@Override public Bitstream clone(Context context, Bitstream bitstream) throws SQLException { // Create a new bitstream with a new ID. Bitstream clonedBitstream = bitstreamDAO.create(context, new Bitstream()); // Set the internal identifier, file size, checksum, and // checksum algorithm as same as the given bitstream. clonedBitstream.setInternalId(bitstream.getInternalId()); clonedBitstream.setSizeBytes(bitstream.getSizeBytes()); clonedBitstream.setChecksum(bitstream.getChecksum()); clonedBitstream.setChecksumAlgorithm(bitstream.getChecksumAlgorithm()); clonedBitstream.setFormat(bitstream.getBitstreamFormat()); try { //Update our bitstream but turn off the authorization system since permissions //haven't been set at this point in time. context.turnOffAuthorisationSystem(); update(context, clonedBitstream); } catch (AuthorizeException e) { log.error(e); //Can never happen since we turn off authorization before we update } finally { context.restoreAuthSystemState(); } return clonedBitstream; }