DataBufferPassivationHandler.java
1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.adobe.service.DataBuffer
*/
package com.adobe.aemfd.docmanager.internal.passivation;
import com.adobe.aemfd.docmanager.internal.io.DataBufferInputStream;
import com.adobe.aemfd.docmanager.internal.source.DataBufferSourceHandler;
import com.adobe.aemfd.docmanager.passivation.AbstractPassivationHandler;
import com.adobe.aemfd.docmanager.passivation.PassivationConnection;
import com.adobe.aemfd.docmanager.passivation.PassivationType;
import com.adobe.aemfd.docmanager.source.DocumentSourceHandler;
import com.adobe.service.DataBuffer;
import java.io.IOException;
import java.io.InputStream;
public class DataBufferPassivationHandler
extends AbstractPassivationHandler {
private DataBuffer dataBuffer;
public DataBufferPassivationHandler(DataBuffer dataBuffer) {
super(false, true, true);
this.dataBuffer = dataBuffer;
}
public PassivationConnection openConnectionForPassivation() throws IOException {
DataBufferInputStream is = new DataBufferInputStream(this.dataBuffer);
return new PassivationConnection(is, this.dataBuffer.getBufLength(), this.dataBuffer.getContentType());
}
protected DocumentSourceHandler doPassivate(byte[] preBuffer, PassivationConnection conn, long length) throws IOException {
return new DataBufferSourceHandler(this.dataBuffer, length, conn.getContentType());
}
public void release(boolean passivated, PassivationType pType) {
this.dataBuffer = null;
}
}