code: private void addString(String str, OutputStream os) throws IOException {
  		if (this.cacheSize >= 0) { // add to disk
  			byte[] strbytes = str.getBytes(EncryptedCachedDiskStringsTable.encoding);
  			byte[] sizeOfStr = ByteBuffer.allocate(4).putInt(strbytes.length).array();
  			this.stringPositionInFileList.add(this.tempFileSize);
  			if (os != null) {
  				os.write(sizeOfStr);
  				os.write(strbytes);
  			} else { // we can write to the random access file
  				FileChannel fc = this.tempRAF.getChannel().position(this.tempFileSize);
  				fc.write(ByteBuffer.wrap(sizeOfStr));
  				fc.write(ByteBuffer.wrap(strbytes));
  			}
  			this.tempFileSize += sizeOfStr.length + strbytes.length;
  		}
  		if (this.cacheSize < 0) { // put it into cache
  			this.cache.put(this.currentItem, str);
  			this.currentItem++;
  		} else if ((this.cacheSize > 0) && (this.currentItem < this.cacheSize)) { // put the first items already into
  																					// cache
  			this.cache.put(this.currentItem, str);
  			this.currentItem++;
  		}
  	}
docs: Adds a string to the table on disk
  
  @param str string to store
  @param os  OutputStream to use to write it
  @throws IOException