This repository has been archived by the owner on May 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create DataExchangeFilter and pipeline filter processing for #26
- Loading branch information
Showing
2 changed files
with
91 additions
and
2 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
src/main/java/tv/hd3g/transfertfiles/DataExchangeFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* This file is part of transfertfiles. | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation; either version 3 of the License, or | ||
* any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* Copyright (C) hdsdi3g for hd3g.tv 2021 | ||
* | ||
*/ | ||
package tv.hd3g.transfertfiles; | ||
|
||
import java.nio.ByteBuffer; | ||
import java.util.List; | ||
|
||
@FunctionalInterface | ||
public interface DataExchangeFilter { | ||
|
||
/** | ||
* @param dataSource in read-only | ||
* @return empty for "ignore" filter/data collector filter | ||
* null for stop data transfert operation | ||
* returned ByteBuffers can be re-used here (processed internaly in read-ony) | ||
*/ | ||
List<ByteBuffer> applyDataFilter(ByteBuffer dataSource); | ||
|
||
/** | ||
* Next applyDataFilter call will be the last | ||
*/ | ||
default void close() { | ||
} | ||
|
||
default String getFilterName() { | ||
return null; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters